From 327e00b0ba12cffbb89355aaada5c5aa9ed84f10 Mon Sep 17 00:00:00 2001 From: MaxxSoftware Date: Wed, 28 Nov 2012 12:45:14 +0600 Subject: [PATCH] Firefox Tab and Enter keys issue. When item is selected by enter, the list is reopened. Also pressing tab on focused element with drop list cause immediate reopening with empty search result list. --- select2.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/select2.js b/select2.js index ca355440..1e686881 100644 --- a/select2.js +++ b/select2.js @@ -1584,6 +1584,9 @@ the specific language governing permissions and limitations under the Apache Lic } })); selection.bind("keypress", this.bind(function(e) { + if (e.which == KEY.DELETE || e.which == KEY.BACKSPACE || e.which == KEY.TAB || e.which == KEY.ENTER || e.which == 0) { + return + } var key = String.fromCharCode(e.which); this.search.val(key); this.open();