Skip to content

Commit

Permalink
Update PinInput.tsx
Browse files Browse the repository at this point in the history
move focus after paste()
  • Loading branch information
SomiDivian authored Jul 16, 2023
1 parent 53fe8f8 commit 258c9e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/mantine-core/src/PinInput/PinInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ export const PinInput = forwardRef<HTMLDivElement, PinInputProps>((props, ref) =

if (isValid) {
setValues(copyValue);
const indexToFocus =
copyValue.length - 1 < length
? copyValue.length - 1
: length - 1;
inputsRef.current[indexToFocus].focus();
}
};

Expand Down

0 comments on commit 258c9e0

Please sign in to comment.