Parcourir la source

ignore modifier keys when enter is pressed. fixes #836

Igor Vaynberg il y a 12 ans
Parent
commit
b3a0c3269a
1 fichiers modifiés avec 6 ajouts et 2 suppressions
  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();