diff --git a/src/generators/dom/visitors/Element/Element.js b/src/generators/dom/visitors/Element/Element.js index 9b451f1348..20d4404638 100644 --- a/src/generators/dom/visitors/Element/Element.js +++ b/src/generators/dom/visitors/Element/Element.js @@ -63,7 +63,7 @@ export default function visitElement ( generator, block, state, node ) { .forEach( attribute => { // +

selected: nothing

+ `, + + test ( assert, component, target ) { + component.set({ + items: [ 'one', 'two', 'three' ], + selected: 'two' + }); + + const options = target.querySelectorAll( 'option' ); + assert.ok( !options[0].selected ); + assert.ok( options[1].selected ); + assert.ok( !options[2].selected ); + + assert.htmlEqual( target.innerHTML, ` + +

selected: two

+ ` ); + + component.destroy(); + } +}; diff --git a/test/runtime/samples/binding-select-late/main.html b/test/runtime/samples/binding-select-late/main.html new file mode 100644 index 0000000000..0bbebef662 --- /dev/null +++ b/test/runtime/samples/binding-select-late/main.html @@ -0,0 +1,7 @@ + + +

selected: {{selected || 'nothing'}}