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:
Pl217
2018-05-24 23:14:59 +02:00
committed by Niklas Laxström
parent 5dfca5fd8a
commit 44bd07f038

View File

@@ -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 ) );