Skip to content

Commit cafc44c

Browse files
authored
Merge pull request #1868 from fabienwnklr/master
Fix dropdown open on submit when input is invalid
2 parents ece3c23 + 4bece8f commit cafc44c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/selectize.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,13 @@ $.extend(Selectize.prototype, {
18921892
open: function() {
18931893
var self = this;
18941894

1895-
if (self.isLocked || self.isOpen || (self.settings.mode === 'multi' && self.isFull())) return;
1895+
if (
1896+
self.isLocked ||
1897+
self.isOpen ||
1898+
(self.settings.mode === "multi" && self.isFull()) ||
1899+
self.$control_input.is(":invalid")
1900+
)
1901+
return;
18961902
self.focus();
18971903
self.isOpen = true;
18981904
self.refreshState();

0 commit comments

Comments
 (0)