Skip to content

Field error not displaying in dynamic form #7016

Closed

Description

@canac

Description

I believe I've found a bug in the API with forms when the number of form elements changes. Below is a reproduction. When you type one character into the error input, the error doesn't appear at first until you type a second character. It appears that adding the Form.Description element dynamically interferes with the error prop displaying correctly.

Steps To Reproduce

  1. macOS v12.6.6
  2. Raycast v1.53.2

Reproduction

const [error, setError] = useState("");

return (
  <Form>
    {error && <Form.Description title="Summary" text={error} />}
    <Form.TextField
      id="error1"
      title="Error 1"
      value={error}
      onChange={setError}
    />
    <Form.TextField
      id="error2"
      title="Error 2"
      value={error}
      onChange={setError}
      error={error}
    />
  </Form>
);

Current Behaviour

Typing one character in the error box does not show the error next to the "error2" field until you type a second character.

Expected Behaviour

Typing one character in the error box should show the error next to the "error2" field, even though the Form.Description element is added.

Activity

  1. added
    api
    bug
    on Jun 9, 2023
  2. pernielsentikaer commented on Jun 13, 2023

    @pernielsentikaer
    Contributor

    Thanks for flagging this, should be fixed in the next release 🙂

  3. canac commented on Jun 14, 2023

    @canac
    ContributorAuthor

    I'm still seeing this issue after updating to v1.53.3. Did the bug fix make it into that release?

  4. canac commented on Jun 19, 2023

    @canac
    ContributorAuthor

    Still appears to be broken in v1.53.4.

  5. canac commented on Jun 22, 2023

    @canac
    ContributorAuthor

    This seems to work now in v1.54.0. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apibug

    Type

    No type

    Fields

    Priority

    None yet

    Severity

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions