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

Think about fields with multiple values #8

Closed
kentcdodds opened this issue Sep 8, 2022 · 1 comment · Fixed by #28
Closed

Think about fields with multiple values #8

kentcdodds opened this issue Sep 8, 2022 · 1 comment · Fixed by #28

Comments

@kentcdodds
Copy link
Contributor

For example, this UI:

ui-example.mp4

Powered by this code: https://github.com/kentcdodds/fakebooks-remix/blob/15daa8e1c76a87df7f2af044d9b710d071c2a1f2/app/routes/__app/sales/invoices/new.tsx#L175-L203

And on the server that's validated like this: https://github.com/kentcdodds/fakebooks-remix/blob/15daa8e1c76a87df7f2af044d9b710d071c2a1f2/app/routes/__app/sales/invoices/new.tsx#L79-L93

I wonder how that would look with validity-state 🤔

@brophdawg11
Copy link
Owner

From a UI standpoint, this sort of "just works" since useValidatedInput is scoped to a given input, and IDs are now unique via useId. I think where this will break at the moment is server-side validation since we're probably not doing anything with formData.getAll so we're probably only validating the last of each duplicate input.

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 a pull request may close this issue.

2 participants