diff --git a/components/input/OTP/index.tsx b/components/input/OTP/index.tsx index b3650641f2..7c10017778 100644 --- a/components/input/OTP/index.tsx +++ b/components/input/OTP/index.tsx @@ -208,7 +208,7 @@ const OTP = React.forwardRef((props, ref) => { const nextCells = patchValue(index, txt); const nextIndex = Math.min(index + txt.length, length - 1); - if (nextIndex !== index) { + if (nextIndex !== index && nextCells[index] !== undefined) { refs.current[nextIndex]?.focus(); }