Skip to content

Commit b3a0c32

Browse files
committed
ignore modifier keys when enter is pressed. fixes select2#836
1 parent acdbb02 commit b3a0c32

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

select2.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,8 +2076,12 @@ the specific language governing permissions and limitations under the Apache Lic
20762076
return;
20772077
}
20782078

2079-
if (this.opts.openOnEnter === false && e.which === KEY.ENTER) {
2080-
return;
2079+
if (e.which === KEY.ENTER) {
2080+
if (this.opts.openOnEnter === false) {
2081+
return;
2082+
} else if (e.altKey || e.ctrlKey || e.shiftKey || e.metaKey) {
2083+
return;
2084+
}
20812085
}
20822086

20832087
this.open();

0 commit comments

Comments
 (0)