Skip to content

Commit f89ad00

Browse files
author
ugogo
committed
Fix input blurring when there is no active item
1 parent 58e8585 commit f89ad00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ const ReactInputVerificationCode = ({
100100
};
101101

102102
const onInputBlur = () => {
103-
setActiveIndex(-1);
103+
// https://github.com/ugogo/react-input-verification-code/issues/1
104+
if (activeIndex === -1) return;
105+
104106
blurItem(activeIndex);
107+
setActiveIndex(-1);
105108
};
106109

107110
React.useEffect(() => {

0 commit comments

Comments
 (0)