Skip to content

Commit febd218

Browse files
committed
Fix iOS Chrome autocomplete
iOS chrome autocomplete only fires an `input` event up to the `maxLength`, so we need the input that “supports autocomplete” to accept the full OTP length. Later, in the `input` handler, the PASTE action will be dispatched.
1 parent 08ff067 commit febd218

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/one-time-password-field/src/one-time-password-field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ const OneTimePasswordFieldInput = React.forwardRef<
647647
data-protonpass-ignore={supportsAutoComplete ? undefined : 'true'}
648648
data-bwignore={supportsAutoComplete ? undefined : 'true'}
649649
inputMode={validation?.inputMode}
650-
maxLength={1}
650+
maxLength={supportsAutoComplete ? collection.size : 1}
651651
pattern={validation?.pattern}
652652
readOnly={context.readOnly}
653653
value={char}

0 commit comments

Comments
 (0)