-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Better handling of textareas
- Loading branch information
Showing
17 changed files
with
224 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<textarea> | ||
<p>not actually an element. {{foo}}</p> | ||
</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"hash": 3618147195, | ||
"html": { | ||
"start": 0, | ||
"end": 63, | ||
"type": "Fragment", | ||
"children": [ | ||
{ | ||
"start": 0, | ||
"end": 63, | ||
"type": "Element", | ||
"name": "textarea", | ||
"attributes": [], | ||
"children": [ | ||
{ | ||
"start": 10, | ||
"end": 40, | ||
"type": "Text", | ||
"data": "\n\t<p>not actually an element. " | ||
}, | ||
{ | ||
"start": 40, | ||
"end": 47, | ||
"type": "MustacheTag", | ||
"expression": { | ||
"type": "Identifier", | ||
"start": 42, | ||
"end": 45, | ||
"name": "foo" | ||
} | ||
}, | ||
{ | ||
"start": 47, | ||
"end": 52, | ||
"type": "Text", | ||
"data": "</p>\n" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"css": null, | ||
"js": null | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
'skip-ssr': true, // SSR behaviour is awkwardly different | ||
|
||
data: { | ||
foo: 42 | ||
}, | ||
|
||
html: `<textarea></textarea>`, | ||
|
||
test ( assert, component, target ) { | ||
const textarea = target.querySelector( 'textarea' ); | ||
assert.strictEqual( textarea.value, `\n\t<p>not actually an element. 42</p>\n` ); | ||
|
||
component.set({ foo: 43 }); | ||
assert.strictEqual( textarea.value, `\n\t<p>not actually an element. 43</p>\n` ); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<textarea> | ||
<p>not actually an element. {{foo}}</p> | ||
</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
'skip-ssr': true, // SSR behaviour is awkwardly different | ||
|
||
data: { | ||
foo: 42 | ||
}, | ||
|
||
html: `<textarea></textarea>`, | ||
|
||
test ( assert, component, target ) { | ||
const textarea = target.querySelector( 'textarea' ); | ||
assert.strictEqual( textarea.value, '42' ); | ||
|
||
component.set({ foo: 43 }); | ||
assert.strictEqual( textarea.value, '43' ); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<textarea value='{{foo}}'/> |
3 changes: 3 additions & 0 deletions
3
test/server-side-rendering/samples/textarea-children/_expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<textarea> | ||
<p>not actually an element. 42</p> | ||
</textarea> |
11 changes: 11 additions & 0 deletions
11
test/server-side-rendering/samples/textarea-children/main.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<textarea> | ||
<p>not actually an element. {{foo}}</p> | ||
</textarea> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { foo: 42 }; | ||
} | ||
}; | ||
</script> |
1 change: 1 addition & 0 deletions
1
test/server-side-rendering/samples/textarea-value/_expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<textarea>42</textarea> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<textarea value='{{foo}}'/> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { foo: 42 }; | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[{ | ||
"message": "A <textarea> can have either a value attribute or (equivalently) child content, but not both", | ||
"loc": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"pos": 10 | ||
}] |
Oops, something went wrong.