From b3a0c3269a9c3eae2d7a7a9a71c452b0d60fb2d3 Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Sat, 9 Feb 2013 23:55:34 -0800 Subject: [PATCH] ignore modifier keys when enter is pressed. fixes #836 --- select2.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/select2.js b/select2.js index 39718278..68c0db71 100644 --- a/select2.js +++ b/select2.js @@ -2076,8 +2076,12 @@ the specific language governing permissions and limitations under the Apache Lic return; } - if (this.opts.openOnEnter === false && e.which === KEY.ENTER) { - return; + if (e.which === KEY.ENTER) { + if (this.opts.openOnEnter === false) { + return; + } else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) { + return; + } } this.open();