Skip to content

Commit c55267e

Browse files
Damian SznajderDamian Sznajder
authored andcommitted
Clear reducer value on handleClearInput
1 parent e04b577 commit c55267e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ const OtpInputs = forwardRef<OtpInputsRef, Props>(
122122
(inputIndex: number) => {
123123
const input = inputs.current[inputIndex];
124124
input && input.current && input.current.clear();
125+
dispatch({
126+
type: ACTION_TYPES.setOtpTextForIndex,
127+
payload: {
128+
index: inputIndex,
129+
text: '',
130+
},
131+
});
125132
focusInput(inputIndex - 1);
126133
},
127134
[focusInput],

0 commit comments

Comments
 (0)