|
@@ -1309,7 +1309,16 @@ define('select2/selection/search',[
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- this.$selection.on('keyup', '.select2-search--inline', function (evt) {
|
|
|
|
|
|
+ // Workaround for browsers which do not support the `input` event
|
|
|
|
+ // This will prevent double-triggering of events for browsers which support
|
|
|
|
+ // both the `keyup` and `input` events.
|
|
|
|
+ this.$selection.on('input', '.select2-search--inline', function (evt) {
|
|
|
|
+ // Unbind the duplicated `keyup` event
|
|
|
|
+ $(this).off('keyup');
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.$selection.on('keyup input', '.select2-search--inline',
|
|
|
|
+ function (evt) {
|
|
self.handleSearch(evt);
|
|
self.handleSearch(evt);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
@@ -3172,7 +3181,15 @@ define('select2/dropdown/search',[
|
|
self._keyUpPrevented = evt.isDefaultPrevented();
|
|
self._keyUpPrevented = evt.isDefaultPrevented();
|
|
});
|
|
});
|
|
|
|
|
|
- this.$search.on('keyup', function (evt) {
|
|
|
|
|
|
+ // Workaround for browsers which do not support the `input` event
|
|
|
|
+ // This will prevent double-triggering of events for browsers which support
|
|
|
|
+ // both the `keyup` and `input` events.
|
|
|
|
+ this.$search.on('input', function (evt) {
|
|
|
|
+ // Unbind the duplicated `keyup` event
|
|
|
|
+ $(this).off('keyup');
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ this.$search.on('keyup input', function (evt) {
|
|
self.handleSearch(evt);
|
|
self.handleSearch(evt);
|
|
});
|
|
});
|
|
|
|
|