소스 검색

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();