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

Select component: previous input value persists in UI when submitting a form with use:enhance #1168

Open
tomasohCHOM opened this issue Jul 2, 2024 · 0 comments

Comments

@tomasohCHOM
Copy link

Describe the bug

When use:enhance is attached to a <form> and the user selects an item using shadcn-svelte <Select /> component, the value in the UI will stay the same after submitting the form. However, the value of the Select input element actually remains empty after the form submission, even if the UI shows otherwise. I assume this is not the intended behavior, as if use:enhance is not attached to the form element, the Select components will clear as expected.

Reproduction

I actually tested it using the documentation provided in https://www.shadcn-svelte.com/docs/components/select.
In the following video, I clicked the "Submit" button exactly twice.
https://github.com/huntabyte/shadcn-svelte/assets/112128328/67c33d37-6def-48ae-9834-0d7058d190a9

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12450H
    Memory: 769.44 MB / 7.68 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.11 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Chrome: 126.0.6478.127

Severity

annoyance

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

1 participant