Skip to content

Commit 5450ca1

Browse files
committed
fix(a11y): blur when tabbing out of input
Fixes #1926. To be accessible, it should be possible to easily navigate elements using the keyboard. Previously, when using TAB to navigate through form elements, the input would enter its focused state when focused with TAB (and the dropdown would open when using `openOnFocus`). However, when TAB is used to jump to the next focusable element, it would not lose its focused state, and the dropdown would stay open. This commit restores the behavior before #1813 and ensures that the input leaves its focused state and closes the dropdown when blurred using TAB.
1 parent 20169c3 commit 5450ca1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/selectize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ $.extend(Selectize.prototype, {
218218
keypress : function() { return self.onKeyPress.apply(self, arguments); },
219219
input : function() { return self.onInput.apply(self, arguments); },
220220
resize : function() { self.positionDropdown.apply(self, []); },
221-
// blur : function() { return self.onBlur.apply(self, arguments); },
221+
blur : function() { return self.onBlur.apply(self, arguments); },
222222
focus : function() { self.ignoreBlur = false; return self.onFocus.apply(self, arguments); },
223223
paste : function() { return self.onPaste.apply(self, arguments); }
224224
});

0 commit comments

Comments
 (0)