Fix onInputChange being called twice
ULS input element had onInputChange() handler attached to change, textInput and input events. That caused onInputChange() to be called twice when there is user input and ULS gets closed, since 'change' event fires when <input type="text"> element loses focus. Registering handler only for 'input' is sufficient for the intent.
This commit is contained in:
@@ -59,10 +59,7 @@
|
||||
|
||||
listen: function () {
|
||||
this.$element.on( 'keydown', this.keypress.bind( this ) );
|
||||
this.$element.on(
|
||||
'change textInput input',
|
||||
$.fn.uls.debounce( this.onInputChange.bind( this ), 300 )
|
||||
);
|
||||
this.$element.on( 'input', $.fn.uls.debounce( this.onInputChange.bind( this ), 300 ) );
|
||||
|
||||
if ( this.$clear.length ) {
|
||||
this.$clear.on( 'click', this.clear.bind( this ) );
|
||||
|
||||
Reference in New Issue
Block a user