Skip to content

Commit

Permalink
boy do i feel stupid. fixes #1022
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 24, 2017
1 parent 8472142 commit 2120a81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/nodes/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default class Element extends Node {
attribute.name === 'value'
) {
let select = this.parent;
while (select && select.type !== 'Element' || select.name !== 'select') select = select.parent;
while (select && (select.type !== 'Element' || select.name !== 'select')) select = select.parent;

if (select && select.selectBindingDependencies) {
select.selectBindingDependencies.forEach(prop => {
Expand Down
16 changes: 16 additions & 0 deletions test/runtime/samples/option-without-select/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
solo: true,

data: {
foo: 'hello'
},

html: `<option value='hello'>hello</option>`,

test(assert, component, target) {
component.set({ foo: 'goodbye' });
assert.htmlEqual(target.innerHTML, `
<option value='goodbye'>goodbye</option>
`);
}
};
1 change: 1 addition & 0 deletions test/runtime/samples/option-without-select/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<option value='{{foo}}'>{{foo}}</option>

0 comments on commit 2120a81

Please sign in to comment.