Browse Source

ignore modifier keys when enter is pressed. fixes #836

Igor Vaynberg 12 năm trước cách đây
mục cha
commit
b3a0c3269a
1 tập tin đã thay đổi với 6 bổ sung2 xóa
  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();