Skip to content

Commit

Permalink
Feed back the keypress code that was responsible for the 'close' even… (
Browse files Browse the repository at this point in the history
#5513)

* Feed back the keypress code that was responsible for the 'close' event s part of the event parameters

* Update core.js
  • Loading branch information
6pac authored and kevin-brown committed Jan 28, 2020
1 parent 42364b1 commit 3b69d35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/select2/core.js
Expand Up @@ -331,7 +331,7 @@ define([
if (self.isOpen()) {
if (key === KEYS.ESC || key === KEYS.TAB ||
(key === KEYS.UP && evt.altKey)) {
self.close();
self.close(evt);

evt.preventDefault();
} else if (key === KEYS.ENTER) {
Expand Down Expand Up @@ -474,12 +474,12 @@ define([
this.trigger('query', {});
};

Select2.prototype.close = function () {
Select2.prototype.close = function (evt) {
if (!this.isOpen()) {
return;
}

this.trigger('close', {});
this.trigger('close', { originalEvent : evt });
};

Select2.prototype.isOpen = function () {
Expand Down

0 comments on commit 3b69d35

Please sign in to comment.