mirror of https://github.com/sveltejs/svelte
Merge pull request #427 from sveltejs/gh-423
Make <select> elements use .value prop to update valuepull/435/head
commit
6074178c65
@ -0,0 +1,19 @@
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
|
||||
data: {
|
||||
foo: 'a'
|
||||
},
|
||||
|
||||
test ( assert, component, target ) {
|
||||
const options = target.querySelectorAll( 'option' );
|
||||
|
||||
assert.equal( options[0].selected, true );
|
||||
assert.equal( options[1].selected, false );
|
||||
|
||||
component.set( { foo: 'b' } );
|
||||
|
||||
assert.equal( options[0].selected, false );
|
||||
assert.equal( options[1].selected, true );
|
||||
}
|
||||
};
|
@ -0,0 +1,4 @@
|
||||
<select value="{{foo}}">
|
||||
<option>a</option>
|
||||
<option>b</option>
|
||||
</select>
|
Loading…
Reference in new issue