diff --git a/src/generators/dom/visitors/Element/lookup.ts b/src/generators/dom/visitors/Element/lookup.ts index 41fc249e61..de48507fea 100644 --- a/src/generators/dom/visitors/Element/lookup.ts +++ b/src/generators/dom/visitors/Element/lookup.ts @@ -109,7 +109,7 @@ const lookup = { title: {}, type: { appliesTo: [ 'button', 'input', 'command', 'embed', 'object', 'script', 'source', 'style', 'menu' ] }, usemap: { propertyName: 'useMap', appliesTo: [ 'img', 'input', 'object' ] }, - value: { appliesTo: [ 'button', 'option', 'input', 'li', 'meter', 'progress', 'param', 'select' ] }, + value: { appliesTo: [ 'button', 'option', 'input', 'li', 'meter', 'progress', 'param', 'select', 'textarea' ] }, width: { appliesTo: [ 'canvas', 'embed', 'iframe', 'img', 'input', 'object', 'video' ] }, wrap: { appliesTo: [ 'textarea' ] } }; diff --git a/test/runtime/samples/textarea-value/_config.js b/test/runtime/samples/textarea-value/_config.js new file mode 100644 index 0000000000..89ff63508c --- /dev/null +++ b/test/runtime/samples/textarea-value/_config.js @@ -0,0 +1,17 @@ +export default { + 'skip-ssr': true, // SSR behaviour is awkwardly different + + data: { + foo: 42 + }, + + html: ``, + + test ( assert, component, target ) { + const textarea = target.querySelector( 'textarea' ); + assert.strictEqual( textarea.value, '42' ); + + component.set({ foo: 43 }); + assert.strictEqual( textarea.value, '43' ); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/textarea-value/main.html b/test/runtime/samples/textarea-value/main.html new file mode 100644 index 0000000000..215166ab10 --- /dev/null +++ b/test/runtime/samples/textarea-value/main.html @@ -0,0 +1 @@ +