Skip to content

Commit ba7a89b

Browse files
committed
rename type in KeyboardActionDetails to clarify purpose
1 parent cfe974e commit ba7a89b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react/one-time-password-field/src/one-time-password-field.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ const OneTimePasswordFieldInput = React.forwardRef<
684684
// additional input. Handle this the same as if a user were
685685
// pasting a value.
686686
event.preventDefault();
687-
userActionRef.current = { type: 'paste' };
687+
userActionRef.current = { type: 'autocomplete-paste' };
688688
dispatch({ type: 'PASTE', value });
689689
keyboardActionTimeoutRef.current = window.setTimeout(() => {
690690
userActionRef.current = null;
@@ -705,7 +705,7 @@ const OneTimePasswordFieldInput = React.forwardRef<
705705
// of just the value of the given input?
706706
dispatch({ type: 'CLEAR_CHAR', index, reason: 'Cut' });
707707
return;
708-
case 'paste':
708+
case 'autocomplete-paste':
709709
// the PASTE handler will already set the value and focus the final
710710
// input; we want to skip focusing the wrong element if the browser fires
711711
// onChange for the first input. This sometimes happens during autocomplete.
@@ -940,7 +940,7 @@ type KeyboardActionDetails =
940940
ctrlKey: boolean;
941941
}
942942
| { type: 'cut' }
943-
| { type: 'paste' };
943+
| { type: 'autocomplete-paste' };
944944

945945
type UpdateAction =
946946
| {

0 commit comments

Comments
 (0)