Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field error not displaying in dynamic form #7016

Closed
canac opened this issue Jun 9, 2023 · 4 comments
Closed

Field error not displaying in dynamic form #7016

canac opened this issue Jun 9, 2023 · 4 comments
Labels
api Issues related to API bug Something isn't working

Comments

@canac
Copy link
Contributor

canac commented Jun 9, 2023

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.

@canac canac added api Issues related to API bug Something isn't working labels Jun 9, 2023
@canac canac mentioned this issue Jun 9, 2023
5 tasks
@pernielsentikaer
Copy link
Collaborator

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

@canac
Copy link
Contributor Author

canac commented Jun 14, 2023

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

@canac
Copy link
Contributor Author

canac commented Jun 19, 2023

Still appears to be broken in v1.53.4.

@canac
Copy link
Contributor Author

canac commented Jun 22, 2023

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
Labels
api Issues related to API bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants