Skip to content

Commit dc84816

Browse files
authored
Merge pull request #17 from johelder/bugfix/copy-paste-otp-code
copy-paste otp code
2 parents 331b2f4 + 60e76f7 commit dc84816

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/hooks/use-text-input-otp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export function TextInputOTPProvider({
5050

5151
if (text.length === maxLength) {
5252
onFilled?.(text);
53+
setCurrentIndex(text.length - 1);
54+
return;
5355
}
5456

5557
if (text.length < maxLength) {

0 commit comments

Comments
 (0)