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

<textarea value='{{foo}}'> doesn't work #582

Closed
Rich-Harris opened this issue May 11, 2017 · 4 comments · Fixed by #599
Closed

<textarea value='{{foo}}'> doesn't work #582

Rich-Harris opened this issue May 11, 2017 · 4 comments · Fixed by #599
Labels

Comments

@Rich-Harris
Copy link
Member

Repro here — the generated code is wrong:

if ( textarea_value_value !== ( textarea_value_value = state.foo ) ) {
-  setAttribute( textarea, 'value', textarea_value_value );
+  textarea.value = textarea_value_value;
}
@Conduitry
Copy link
Member

<textarea>{{foo}}</textarea> works, doesn't it? I'm not sure why we'd want to support <textarea value='{{foo}}> when <textarea value='some text'> doesn't work in regular HTML. I might be being overly pedantic.

@Rich-Harris
Copy link
Member Author

Because the way that you update the contents of a textarea is with textarea.value = content - I'd argue it's more natural (and certainly easier to implement!) than <textarea>{{value}}</textarea>

@taylorzane
Copy link
Contributor

Just ran into this issue moments ago, and I was about to open an issue about this. I'm glad you ran into this as well!

@PaulBGD
Copy link
Member

PaulBGD commented May 13, 2017

I don't see a reason not to allow using value, adds parity with the other form elements and since this is a compiler it doesn't add more code to the output.

Rich-Harris added a commit that referenced this issue May 28, 2017
Better handling of textareas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants