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

#each+<select>+on:change are not working #590

Closed
peter23 opened this issue May 18, 2017 · 1 comment
Closed

#each+<select>+on:change are not working #590

peter23 opened this issue May 18, 2017 · 1 comment

Comments

@peter23
Copy link

peter23 commented May 18, 2017

You can see this bug here: https://svelte.technology/repl?gist=1c4a9db0b3ce319f4e893138e5a6398d

list0 - on:change is working without problems

lists inside #each block - on:change is not working (Uncaught TypeError: Cannot read property 'component' of undefined
at HTMLSelectElement.change_handler (eval at U (bundle.61a4bf9….js:6), :170:30)
change_handler @ VM816:170
)

inputs inside #each block - on:change is working without problems

@Conduitry
Copy link
Member

This looks related to my changes in #521. childState.allUsedContexts and childState.usesComponent apparently aren't getting updated in time when we're deferring visiting all of the <select> element's attributes - and so we don't generate the code that initializes or updates the values in _svelte on the element.

Conduitry added a commit that referenced this issue May 19, 2017
When visiting `<select>` elements, don't try to add props until after
the (delayed) visiting of the attributes, as that's when we determine
what the props should be.
Rich-Harris added a commit that referenced this issue May 21, 2017
On `<select>`, don't try generating prop code until visiting attributes
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