Skip to content

Commit 3b69d35

Browse files
6packevin-brown
authored andcommitted
Feed back the keypress code that was responsible for the 'close' even… (select2#5513)
* Feed back the keypress code that was responsible for the 'close' event s part of the event parameters * Update core.js
1 parent 42364b1 commit 3b69d35

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/js/select2/core.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ define([
331331
if (self.isOpen()) {
332332
if (key === KEYS.ESC || key === KEYS.TAB ||
333333
(key === KEYS.UP && evt.altKey)) {
334-
self.close();
334+
self.close(evt);
335335

336336
evt.preventDefault();
337337
} else if (key === KEYS.ENTER) {
@@ -474,12 +474,12 @@ define([
474474
this.trigger('query', {});
475475
};
476476

477-
Select2.prototype.close = function () {
477+
Select2.prototype.close = function (evt) {
478478
if (!this.isOpen()) {
479479
return;
480480
}
481481

482-
this.trigger('close', {});
482+
this.trigger('close', { originalEvent : evt });
483483
};
484484

485485
Select2.prototype.isOpen = function () {

0 commit comments

Comments
 (0)