Skip to content

Commit d00d1e4

Browse files
fix: android backspace not working (#390)
1 parent e7cc58e commit d00d1e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const OTPInput = ({
125125

126126
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
127127
const otp = getOTPValue();
128-
if (event.code === 'Backspace') {
128+
if ([event.code, event.key].includes('Backspace')) {
129129
event.preventDefault();
130130
changeCodeAtFocus('');
131131
focusInput(activeInput - 1);

0 commit comments

Comments
 (0)