Skip to content

fix(core): allow optional text fields in dynamic form#2782

Merged
jorgemoya merged 1 commit intocanaryfrom
catalyst-1618-fix-text-dynamic-form
Dec 15, 2025
Merged

fix(core): allow optional text fields in dynamic form#2782
jorgemoya merged 1 commit intocanaryfrom
catalyst-1618-fix-text-dynamic-form

Conversation

@jorgemoya
Copy link
Contributor

What/Why?

Add missing check for optional text field in core/vibes/soul/form/dynamic-form/schema.ts.

Closes #2781

Testing

Before
screencapture-localhost-3000-register-2025-12-15-11_47_08

After
screencapture-localhost-3000-register-2025-12-15-11_46_38

Migration

Add if (field.required !== true) fieldSchema = fieldSchema.optional(); to text case in core/vibes/soul/form/dynamic-form/schema.ts:

case 'text':
    fieldSchema = z.string();

    if (field.pattern != null) {
    fieldSchema = fieldSchema.regex(new RegExp(field.pattern), {
        message: 'Invalid format.',
    });
    }

    if (field.required !== true) fieldSchema = fieldSchema.optional();

    break;

@jorgemoya jorgemoya requested a review from a team as a code owner December 15, 2025 17:48
@changeset-bot
Copy link

changeset-bot bot commented Dec 15, 2025

🦋 Changeset detected

Latest commit: e0f68dc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@bigcommerce/catalyst-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
catalyst-b2b Ready Ready Preview, Comment Dec 15, 2025 5:49pm
catalyst-canary Ready Ready Preview, Comment Dec 15, 2025 5:49pm
2 Skipped Deployments
Project Deployment Review Updated (UTC)
catalyst Ignored Ignored Dec 15, 2025 5:49pm
catalyst-uplift-vertex Ignored Ignored Dec 15, 2025 5:49pm

@jorgemoya jorgemoya added this pull request to the merge queue Dec 15, 2025
Merged via the queue into canary with commit abcb16a Dec 15, 2025
13 checks passed
@jorgemoya jorgemoya deleted the catalyst-1618-fix-text-dynamic-form branch December 15, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic form schema text ignoring required:false

2 participants