-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Binding to properties of bindings fails #639
Comments
Sync state with view if <select> binding does not have initial value
mark indirect dependencies of <select> bindings
I stumbled upon this problem a long time ago (< svelte v1.0), but was not able pin down what exactly was going wrong. I would agree that the first option should be selected and it's bound values be updated. I had to do workarounds like this: https://github.com/hexagon6/wave/blob/svelte/src/components/Algorithm.html#L21 to set the initial value. |
Also this issue might be related to #502 but I am not sure. |
Fixed in recent versions |
A couple of errors here (no REPL link, because I can't access the gist API — sveltejs/v2.svelte.dev#97):
Firstly,
selected
should (I think) default to the first task if not otherwise specified, because otherwise there's a discrepancy between state and UI.Secondly, toggling the
done
state of a given task would ideally cause theeach tasks...
block to update. Right now, it doesn't, because the generated code looks like this:Presumably, then, whenever we have a
<select bind:value='foo.bar.baz'>
binding, we need to add all the dependencies of the select's child<option>
element values (justtasks
in this case) as dependencies ofselected
, and any time we get the dependencies ofselected
, we also get its dependencies. In other words, we generate this code:It may be less straightforward in practice. Let's find out!
The text was updated successfully, but these errors were encountered: