@@ -20,22 +20,24 @@ module.exports = {
20
20
? 'change'
21
21
: 'input'
22
22
23
- // determin the attribute to change when updating
23
+ // determine the attribute to change when updating
24
24
var attr = self . attr = type === 'checkbox'
25
25
? 'checked'
26
26
: ( tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA' )
27
27
? 'value'
28
28
: 'innerHTML'
29
29
30
- var compositionLock = false
31
- this . cLock = function ( ) {
32
- compositionLock = true
33
- }
34
- this . cUnlock = function ( ) {
35
- compositionLock = false
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 )
36
40
}
37
- el . addEventListener ( 'compositionstart' , this . cLock )
38
- el . addEventListener ( 'compositionend' , this . cUnlock )
39
41
40
42
// attach listener
41
43
self . set = self . filters
@@ -118,8 +120,10 @@ module.exports = {
118
120
unbind : function ( ) {
119
121
var el = this . el
120
122
el . removeEventListener ( this . event , this . set )
121
- el . removeEventListener ( 'compositionstart' , this . cLock )
122
- el . removeEventListener ( 'compositionend' , this . cUnlock )
123
+ if ( this . filters ) {
124
+ el . removeEventListener ( 'compositionstart' , this . cLock )
125
+ el . removeEventListener ( 'compositionend' , this . cUnlock )
126
+ }
123
127
if ( isIE9 ) {
124
128
el . removeEventListener ( 'cut' , this . onCut )
125
129
el . removeEventListener ( 'keyup' , this . onDel )
0 commit comments