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

Check spreading of field props on all Field components #2372

Open
david-crespo opened this issue Aug 15, 2024 · 0 comments
Open

Check spreading of field props on all Field components #2372

david-crespo opened this issue Aug 15, 2024 · 0 comments
Labels

Comments

@david-crespo
Copy link
Collaborator

We should check each of the *Field components in app/components/form/fields to see how we're passing the props from useController. There was one case (see below) where we were missing ref, that was very important for focusing the field on validation error. But even in cases that don't appear broken right now, failing to pass onBlur or disabled could mean things don't work the way we expect in the future. See #1895, where we hope to use a top-level disabled prop on the form to disable all fields instead of doing it manually one by one.


Something I noticed while looking at this is that even after adding ref, we are not giving all the props from field to Listbox. We are still missing onBlur and disabled, both of which could become more UX-relevant in the future. For example, if we change a form from the RHF default of validating on submit to validating on blur, the lack of onBlur here will be a problem. Similarly, if we do #1895, I think the lack of disabled here will be a problem. We can fix it here, but I'm guessing there are a bunch more cases like this.

Originally posted in #2364 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant