瀏覽代碼

ignore modifier keys when enter is pressed. fixes #836

Igor Vaynberg 12 年之前
父節點
當前提交
b3a0c3269a
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      select2.js

+ 6 - 2
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();