File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
test/unit/specs/directives/public Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ Directive.prototype._bind = function () {
109
109
if ( this . bind ) {
110
110
this . bind ( )
111
111
}
112
+ this . _bound = true
112
113
113
114
if ( this . literal ) {
114
115
this . update && this . update ( descriptor . raw )
@@ -156,7 +157,6 @@ Directive.prototype._bind = function () {
156
157
this . update ( watcher . value )
157
158
}
158
159
}
159
- this . _bound = true
160
160
}
161
161
162
162
/**
Original file line number Diff line number Diff line change @@ -53,13 +53,13 @@ export default {
53
53
self . focused = false
54
54
// do not sync value after fragment removal (#2017)
55
55
if ( ! self . _frag || self . _frag . inserted ) {
56
- self . listener ( )
56
+ self . rawListener ( )
57
57
}
58
58
} )
59
59
}
60
60
61
61
// Now attach the main listener
62
- this . listener = function ( ) {
62
+ this . listener = this . rawListener = function ( ) {
63
63
if ( composing || ! self . _bound ) {
64
64
return
65
65
}
Original file line number Diff line number Diff line change @@ -709,8 +709,19 @@ describe('v-model', function () {
709
709
} , 30 )
710
710
setTimeout ( function ( ) {
711
711
expect ( spy . calls . count ( ) ) . toBe ( 1 )
712
+ expect ( spy ) . toHaveBeenCalledWith ( 'd' , 'a' )
712
713
expect ( vm . test ) . toBe ( 'd' )
713
- done ( )
714
+ } , 150 )
715
+ setTimeout ( function ( ) {
716
+ el . firstChild . value = 'e'
717
+ // blur should trigger change instantly without debounce
718
+ trigger ( el . firstChild , 'blur' )
719
+ _ . nextTick ( function ( ) {
720
+ expect ( spy . calls . count ( ) ) . toBe ( 2 )
721
+ expect ( spy ) . toHaveBeenCalledWith ( 'e' , 'd' )
722
+ expect ( vm . test ) . toBe ( 'e' )
723
+ done ( )
724
+ } )
714
725
} , 200 )
715
726
} )
716
727
You can’t perform that action at this time.
0 commit comments