We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4dea39 commit d05d110Copy full SHA for d05d110
core/src/components/input-otp/input-otp.tsx
@@ -711,12 +711,8 @@ export class InputOTP implements ComponentInterface {
711
712
// Focus the next empty input after pasting
713
// If all boxes are filled, focus the last input
714
- const nextEmptyIndex = validChars.length;
715
- if (nextEmptyIndex < length) {
716
- inputRefs[nextEmptyIndex]?.focus();
717
- } else {
718
- inputRefs[length - 1]?.focus();
719
- }
+ const nextEmptyIndex = validChars.length < length ? validChars.length : length - 1;
+ inputRefs[nextEmptyIndex]?.focus();
720
};
721
722
/**
0 commit comments