@@ -27,17 +27,15 @@ module.exports = {
27
27
? 'value'
28
28
: 'innerHTML'
29
29
30
- if ( self . filters ) {
31
- var compositionLock = false
32
- this . cLock = function ( ) {
33
- compositionLock = true
34
- }
35
- this . cUnlock = function ( ) {
36
- compositionLock = false
37
- }
38
- el . addEventListener ( 'compositionstart' , this . cLock )
39
- el . addEventListener ( 'compositionend' , this . cUnlock )
30
+ var compositionLock = false
31
+ this . cLock = function ( ) {
32
+ compositionLock = true
33
+ }
34
+ this . cUnlock = function ( ) {
35
+ compositionLock = false
40
36
}
37
+ el . addEventListener ( 'compositionstart' , this . cLock )
38
+ el . addEventListener ( 'compositionend' , this . cUnlock )
41
39
42
40
// attach listener
43
41
self . set = self . filters
@@ -63,6 +61,7 @@ module.exports = {
63
61
} )
64
62
}
65
63
: function ( ) {
64
+ if ( compositionLock ) return
66
65
// no filters, don't let it trigger update()
67
66
self . lock = true
68
67
self . vm . $set ( self . key , el [ attr ] )
@@ -120,10 +119,8 @@ module.exports = {
120
119
unbind : function ( ) {
121
120
var el = this . el
122
121
el . removeEventListener ( this . event , this . set )
123
- if ( this . filters ) {
124
- el . removeEventListener ( 'compositionstart' , this . cLock )
125
- el . removeEventListener ( 'compositionend' , this . cUnlock )
126
- }
122
+ el . removeEventListener ( 'compositionstart' , this . cLock )
123
+ el . removeEventListener ( 'compositionend' , this . cUnlock )
127
124
if ( isIE9 ) {
128
125
el . removeEventListener ( 'cut' , this . onCut )
129
126
el . removeEventListener ( 'keyup' , this . onDel )
0 commit comments