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

superForms does something strange with form values (bind:value) #391

Open
1 task done
ktarmyshov opened this issue Mar 27, 2024 · 1 comment
Open
1 task done

superForms does something strange with form values (bind:value) #391

ktarmyshov opened this issue Mar 27, 2024 · 1 comment

Comments

@ktarmyshov
Copy link

  • Before posting an issue, read the FAQ and search the previous issues.

Description
A clear and concise description of what the bug is, and, unless obvious, what you expected instead.
I start the form with skeleton modal.
The form contains one text field, and two Ids (selected via ). If I don't bind the value to the $form.id1 and $form.id2. The select options select automatically the first in the list. If I do bind:value={$form.id1} the following happens: The first id is '' (empty string), so the option is not selected, the second is undefined - so the first option in the list is selected. If I change the id1 and id2 order in the schema declaration z.object({id2, id1}) the behaviour is reversed - the id2 is '' (empty string) and id1 is undefined so it is selected. If applicable, a MRE Use one of these stackblitz templates to create a minimal reproducible example that you can link to here: Zod Valibot

@ktarmyshov ktarmyshov added the bug Something isn't working label Mar 27, 2024
@ciscoheat
Copy link
Owner

@ciscoheat ciscoheat removed the bug Something isn't working label Mar 31, 2024
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

No branches or pull requests

2 participants