@@ -20,22 +20,24 @@ module.exports = {
2020 ? 'change'
2121 : 'input'
2222
23- // determin the attribute to change when updating
23+ // determine the attribute to change when updating
2424 var attr = self . attr = type === 'checkbox'
2525 ? 'checked'
2626 : ( tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA' )
2727 ? 'value'
2828 : 'innerHTML'
2929
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 )
3640 }
37- el . addEventListener ( 'compositionstart' , this . cLock )
38- el . addEventListener ( 'compositionend' , this . cUnlock )
3941
4042 // attach listener
4143 self . set = self . filters
@@ -118,8 +120,10 @@ module.exports = {
118120 unbind : function ( ) {
119121 var el = this . el
120122 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+ }
123127 if ( isIE9 ) {
124128 el . removeEventListener ( 'cut' , this . onCut )
125129 el . removeEventListener ( 'keyup' , this . onDel )
0 commit comments