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);
|
decorated.call(this, container, $container);
|
||||||
|
|
||||||
container.on('close', function () {
|
container.on('close', function (evt) {
|
||||||
self._handleSelectOnClose();
|
self._handleSelectOnClose(evt);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
SelectOnClose.prototype._handleSelectOnClose = function () {
|
SelectOnClose.prototype._handleSelectOnClose = function (evt) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
var $highlightedResults = this.getHighlightedResults();
|
var $highlightedResults = this.getHighlightedResults();
|
||||||
|
|
||||||
if ($highlightedResults.length < 1) {
|
if ($highlightedResults.length < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$highlightedResults.trigger('mouseup');
|
self.trigger('select', {
|
||||||
|
originalEvent: evt,
|
||||||
|
data: $highlightedResults.data('data')
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return SelectOnClose;
|
return SelectOnClose;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user