Skip to content

Commit

Permalink
Skip onKeyPress check on Firefox
Browse files Browse the repository at this point in the history
Related to #389
  • Loading branch information
wojtekmaj committed Oct 10, 2021
1 parent cc5f22e commit 03337f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/DateInput/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const isIEOrEdgeLegacy = (
&& /(MSIE|Trident\/|Edge\/)/.test(window.navigator.userAgent)
);

const isFirefox = (
typeof window !== 'undefined'
&& /Firefox/.test(window.navigator.userAgent)
);

function onFocus(event) {
const { target } = event;

Expand Down Expand Up @@ -69,6 +74,11 @@ function makeOnKeyPress(maxLength) {
* exceed maxLength.
*/
return function onKeyPress(event) {
if (isFirefox) {
// See https://github.com/wojtekmaj/react-time-picker/issues/92
return;
}

const { key, target: input } = event;
const { value } = input;

Expand Down

0 comments on commit 03337f8

Please sign in to comment.