-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
bind:value for keyed select tag doesn't work when options are updated #1764
Comments
yep, it's definitely my #1730 case. |
As a horrid hack I've got this, any improvements most welcome edit: solution below is much better, thanks! |
@aubergene Hi! A quick workaround for this issue: <option selected={selected === item.slug} value="{item.slug}">{item.name}</option> |
Updated REPL for v3 (still broken) https://svelte.dev/repl/2c67955263d74afaa639dc4ef4c9fe2c?version=3.6.2 |
I also update my example to v3: https://svelte.dev/repl/a2e1ae9fd08640d494b892a135df3c8f?version=3 @Rich-Harris maybe you know, have any chance to change browser API here? |
At the same time as fixing this, we should also make it a compile-time error to specify |
Hello 👋 Is there any update on this issue, or possible v3 workarounds in the interim? |
This is fixed at last in 3.23.0 - https://svelte.dev/repl/2c67955263d74afaa639dc4ef4c9fe2c?version=3.23.0 |
The selected value is known oncreate, but the
<option>
values are added later. The selected value isn't set when they are added.https://svelte.technology/repl?version=2.13.5&gist=17b698af0622793d4ab86ae62e275a51
Looks like it's related/similar to #1730 #1252 #1711
The text was updated successfully, but these errors were encountered: