diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index 03838039ad10..4357f963552f 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -119,9 +119,11 @@ export default function(node: Element, renderer: Renderer, options: RenderOption } else if (binding.name === 'value' && node.name === 'textarea') { const snippet = expression.node; node_contents = x`${snippet} || ""`; + } else if (binding.name === 'value' && node.name === 'select') { + // NOTE: do not add "value" attribute on } else { const snippet = expression.node; - renderer.add_expression(x`@add_attribute("${name}", ${snippet}, 1)`); + renderer.add_expression(x`@add_attribute("${name}", ${snippet}, ${boolean_attributes.has(name) ? 1 : 0})`); } }); diff --git a/test/runtime/samples/apply-directives-in-order/_config.js b/test/runtime/samples/apply-directives-in-order/_config.js index 7c8f87ef857f..0c85c97f8b58 100644 --- a/test/runtime/samples/apply-directives-in-order/_config.js +++ b/test/runtime/samples/apply-directives-in-order/_config.js @@ -9,7 +9,7 @@ export default { `, ssrHtml: ` - +
`, diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js index 1180424e81db..907aa52e6e69 100644 --- a/test/runtime/samples/bindings-global-dependency/_config.js +++ b/test/runtime/samples/bindings-global-dependency/_config.js @@ -1,3 +1,4 @@ export default { - html: '' + html: '', + ssrHtml: '' }; diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js index b2870140659c..f43a6834a883 100644 --- a/test/runtime/samples/component-binding-computed/_config.js +++ b/test/runtime/samples/component-binding-computed/_config.js @@ -3,6 +3,10 @@ export default { `, + ssrHtml: ` + + + `, async test({ assert, component, target, window }) { const input = new window.Event('input'); diff --git a/test/runtime/samples/component-binding-store/_config.js b/test/runtime/samples/component-binding-store/_config.js index d17b9e2d8098..8bbdab17ee50 100644 --- a/test/runtime/samples/component-binding-store/_config.js +++ b/test/runtime/samples/component-binding-store/_config.js @@ -4,6 +4,11 @@ export default { `, + ssrHtml: ` + + + + `, async test({ assert, component, target, window }) { let count = 0; diff --git a/test/runtime/samples/component-slot-fallback-6/_config.js b/test/runtime/samples/component-slot-fallback-6/_config.js index b32d96db2e81..be47d31d0338 100644 --- a/test/runtime/samples/component-slot-fallback-6/_config.js +++ b/test/runtime/samples/component-slot-fallback-6/_config.js @@ -4,6 +4,10 @@ export default { {"value":""} `, + ssrHtml: ` + + {"value":""} + `, async test({ assert, target, window }) { const input = target.querySelector('input'); diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js index 042bdca6ecec..7beda8d3d5a7 100644 --- a/test/runtime/samples/component-slot-spread-props/_config.js +++ b/test/runtime/samples/component-slot-spread-props/_config.js @@ -5,6 +5,12 @@ export default { `, + ssrHtml: ` +