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

Initialize select element value upon creation of component. #502

Merged

Conversation

taylorzane
Copy link
Contributor

This PR fixes an issue where a select element is not set to the correct value on the initial creation of a component.

Mainly done in response to @saibotsivad, but I have also experienced this behavior when writing Svelte components with select elements.

This snippet simply forces the select item to update after the each_block has been rendered, allowing select.value to be set.

I have not included the test that @saibotsivad created to prevent plagiarism.

/cc @saibotsivad

@Rich-Harris Rich-Harris merged commit 0466f38 into sveltejs:master Apr 19, 2017
@Rich-Harris
Copy link
Member

Thanks both! I pulled in @saibotsivad's test, so this should stay fixed. Will cut a release shortly

@saibotsivad
Copy link
Contributor

You two rock, thanks!

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

Successfully merging this pull request may close these issues.

3 participants