File tree 3 files changed +34
-1
lines changed
src/compile/render-dom/wrappers/Element
test/runtime/samples/binding-this-and-value
3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -403,7 +403,9 @@ export default class ElementWrapper extends Wrapper {
403
403
const groups = events
404
404
. map ( event => ( {
405
405
events : event . eventNames ,
406
- bindings : mungedBindings . filter ( binding => event . filter ( this . node , binding . name ) )
406
+ bindings : mungedBindings
407
+ . filter ( binding => binding . name !== 'this' )
408
+ . filter ( binding => event . filter ( this . node , binding . name ) )
407
409
} ) )
408
410
. filter ( group => group . bindings . length ) ;
409
411
Original file line number Diff line number Diff line change
1
+ export default {
2
+ html : `
3
+ <input>
4
+ <p>value: initial</p>
5
+ ` ,
6
+
7
+ ssrHtml : `
8
+ <input value="initial">
9
+ <p>value: initial</p>
10
+ ` ,
11
+
12
+ async test ( { assert, target, window } ) {
13
+ const input = target . querySelector ( 'input' ) ;
14
+ const event = new window . Event ( 'input' ) ;
15
+
16
+ input . value = 'changed' ;
17
+ await input . dispatchEvent ( event ) ;
18
+
19
+ assert . htmlEqual ( target . innerHTML , `
20
+ <input>
21
+ <p>value: changed</p>
22
+ ` ) ;
23
+ }
24
+ } ;
Original file line number Diff line number Diff line change
1
+ < script >
2
+ let node ;
3
+ export let value = 'initial' ;
4
+ </ script >
5
+
6
+ < input bind:this ={node} bind:value >
7
+ < p > value: {value}</ p >
You can’t perform that action at this time.
0 commit comments