Skip to content

Commit

Permalink
Cover a11y issue where focus open picker even if disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
joselrio committed Jan 11, 2024
1 parent 4be7b6e commit 3340822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,10 @@ function FlatpickrInstance(
e?: FocusEvent | MouseEvent,
positionElement = self._positionElement
) {
if (self.input.disabled || self._input.disabled) {
return;
}

if (self.isMobile === true) {
if (e) {
e.preventDefault();
Expand All @@ -2039,7 +2043,7 @@ function FlatpickrInstance(

triggerEvent("onOpen");
return;
} else if (self._input.disabled || self.config.inline) {
} else if (self.config.inline) {
return;
}

Expand Down

0 comments on commit 3340822

Please sign in to comment.