Merge pull request #1048 from sveltejs/gh-1022

allow options outside <select> elements
pull/1049/head
Rich Harris 7 years ago committed by GitHub
commit 831cc411a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 => {

@ -0,0 +1,14 @@
export default {
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>
`);
}
};

@ -0,0 +1 @@
<option value='{{foo}}'>{{foo}}</option>
Loading…
Cancel
Save