From bb2f3a83364c06f2e173196191ea45354b381bef Mon Sep 17 00:00:00 2001 From: sai6855 Date: Wed, 17 Jan 2024 14:17:35 +0530 Subject: [PATCH] handle arrow up, down --- docs/data/base/components/input/OTPInput.js | 4 ++++ docs/data/base/components/input/OTPInput.tsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/data/base/components/input/OTPInput.js b/docs/data/base/components/input/OTPInput.js index b0b19bf5a55302..2612945d447e6a 100644 --- a/docs/data/base/components/input/OTPInput.js +++ b/docs/data/base/components/input/OTPInput.js @@ -17,6 +17,10 @@ function OTP({ seperator, inputCount, otp, setOtp }) { const handleKeyDown = (event, currentIndex) => { switch (event.key) { + case 'ArrowUp': + case 'ArrowDown': + event.preventDefault(); + break; case 'ArrowLeft': event.preventDefault(); if (currentIndex > 0) { diff --git a/docs/data/base/components/input/OTPInput.tsx b/docs/data/base/components/input/OTPInput.tsx index ebab2254556f33..a4f13bdd4c2eb2 100644 --- a/docs/data/base/components/input/OTPInput.tsx +++ b/docs/data/base/components/input/OTPInput.tsx @@ -32,6 +32,10 @@ function OTP({ currentIndex: number, ) => { switch (event.key) { + case 'ArrowUp': + case 'ArrowDown': + event.preventDefault(); + break; case 'ArrowLeft': event.preventDefault(); if (currentIndex > 0) {