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

Bound <select> not initialized to proper value when using <option>s with implicit values #928

Closed
Conduitry opened this issue Nov 15, 2017 · 3 comments

Comments

@Conduitry
Copy link
Member

Compare REPL vs REPL.

Svelte should probably treat a value-less <option> as being the same as one where the value is set to the same as its content.

@Conduitry
Copy link
Member Author

Issue found by @petterek. While this is easily worked around, it does seem to be undesirable behavior on Svelte's part.

@Rich-Harris
Copy link
Member

There's actually another subtle bug here: REPL vs REPL. In the first one, when you change the value, it's setting typeof foo to string, because it's using option.textContent for the value.

I think the correct thing to do here is to reuse the element's children as its value attribute, if it doesn't have one. Working on a PR.

Rich-Harris added a commit that referenced this issue Nov 19, 2017
Reuse <option> children as value attribute, if there isn't one
@Rich-Harris
Copy link
Member

Fixed in 1.42

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