diff --git a/src/index.ts b/src/index.ts index 80c9356f1..ca09c9d29 100644 --- a/src/index.ts +++ b/src/index.ts @@ -532,17 +532,8 @@ function FlatpickrInstance( bind(window.document, "focus", documentClick, { capture: true }); if (self.config.clickOpens === true) { - // To provide a better experience for the use of assistive technologies in mobile devices, - // Let's bind the handler to the focus event instead of click event. - if ( - /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test( - navigator.userAgent - ) - ) { - bind(self._input, "focus", self.open); - } else { - bind(self._input, "click", self.open); - } + bind(self._input, "focus", self.open); + bind(self._input, "click", self.open); } if (self.daysContainer !== undefined) { @@ -2034,6 +2025,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(); @@ -2050,7 +2045,7 @@ function FlatpickrInstance( triggerEvent("onOpen"); return; - } else if (self._input.disabled || self.config.inline) { + } else if (self.config.inline) { return; }