fixes #3169
This commit is contained in:
parent
9318980651
commit
e10f3b7dae
13
src/js/select2/dropdown/selectOnClose.js
vendored
13
src/js/select2/dropdown/selectOnClose.js
vendored
@ -8,19 +8,24 @@ define([
|
||||
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
container.on('close', function () {
|
||||
self._handleSelectOnClose();
|
||||
container.on('close', function (evt) {
|
||||
self._handleSelectOnClose(evt);
|
||||
});
|
||||
};
|
||||
|
||||
SelectOnClose.prototype._handleSelectOnClose = function () {
|
||||
SelectOnClose.prototype._handleSelectOnClose = function (evt) {
|
||||
var self = this;
|
||||
|
||||
var $highlightedResults = this.getHighlightedResults();
|
||||
|
||||
if ($highlightedResults.length < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$highlightedResults.trigger('mouseup');
|
||||
self.trigger('select', {
|
||||
originalEvent: evt,
|
||||
data: $highlightedResults.data('data')
|
||||
});
|
||||
};
|
||||
|
||||
return SelectOnClose;
|
||||
|
Loading…
Reference in New Issue
Block a user