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

ListBox value during Form submission #866

Closed
wants to merge 1 commit into from

Conversation

Sarenor
Copy link
Contributor

@Sarenor Sarenor commented Jan 22, 2023

Added prop to optionally render a hidden input that contains the selected values to ListBox so that the values automatically get submitted during Form submission.

It has the same issues that the SubmitFunction -> FormData.append() solution that I proposed initially has: It's still FormData and can therefore only take strings or blobs.

That means that strings work perfectly well, numbers and arrays will have to be coerced because they are strings like this:

{
    "selectedString": "stringvalue",
    "selectedNumber": "10",
    "multiSelection": "selectionOne,selectionTwo,selectionThree"
}

It's still a better solution than having to include a custom SubmitFunction.

On the other hand, with a custom SubmitFunction we could reset the ListBox to an unselected state like you'd expect it from a Form, that's currently not possible with the hidden input solution proposed here

…cted values to ListBox so that the values automatically get submitted during Form submission
@vercel
Copy link

vercel bot commented Jan 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
skeleton-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 22, 2023 at 10:48AM (UTC)

@endigo9740
Copy link
Contributor

@Sarenor Per our discussion today I'm going to close this, but we will have it available for review if need be. I might have you review the form components as I get through the polish pass review in #862

@endigo9740 endigo9740 closed this Jan 23, 2023
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 this pull request may close these issues.

2 participants