Skip to content

[BUG] Submit button does not work if a required field is hidden #177

Description

@MurzNN

Describe the bug
Submit button does not work if a required field is hidden.

To Reproduce
Steps to reproduce the behavior:

  1. Create a form like this:
const contactSchema = defineSchema({
  fields: [
    {
      type: "text",
      name: "name",
      required: true,
      hidden: { $data: '/sendAsOrganization', eq: true },
    },
    {
      type: "text",
      name: "organization",
      required: true,
      hidden: { $data: '/sendAsOrganization', eq: false },
    },
    {
      type: "checkbox",
      name: "sendAsOrganization",
    },
  ],
});
  1. Click on 'Submit'
  2. See that the submit button become disabled forever, and no submit handler is called, no errors in console.

Expected behavior
We should somehow handle this case properly, or show an error, instead of silently hanging.

Screenshots
Image

Environment (please complete the following information):

  • OS: Linux
  • Browser: Firefox
  • `form-core` / `form-react` Version: 0.1.13

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions