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

Better handling of textareas #599

Merged
merged 5 commits into from
May 28, 2017
Merged

Better handling of textareas #599

merged 5 commits into from
May 28, 2017

Conversation

Rich-Harris
Copy link
Member

This primarily fixes #582, but also address some other behaviour around textareas:

value and children are treated equivalently

<!-- these are the same, as far as Svelte is concerned -->
<textarea value='{{foo}}'/>
<textarea>{{foo}}</textarea>

A textarea with both a value attribute and children will fail validation.

textareas cannot have child elements or if/each blocks

As a corollary to the above:

<!-- these are the same -->
<textarea>
  <p>surprise! this isn't an element</p>
</textarea>

<textarea value="\n\t<p>surprise! this isn't an element</p>\n"/>

SSR

Before (incorrect):

<textarea value="42"></textarea>

After:

<textarea>42</textarea>

@Rich-Harris Rich-Harris merged commit ecc9a93 into master May 28, 2017
@Rich-Harris Rich-Harris deleted the gh-582 branch May 28, 2017 17:55
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.

<textarea value='{{foo}}'> doesn't work
1 participant