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.
2 parents f9b7d6f + bebd427 commit dd97554Copy full SHA for dd97554
src/index.tsx
@@ -149,11 +149,11 @@ const ReactInputVerificationCode = ({
149
150
React.useEffect(() => {
151
const stringValue = value.join('');
152
- const isCompleted = !stringValue.includes(placeholder);
+ const isCompleted = stringValue.length === length;
153
154
if (isCompleted) onCompleted(stringValue);
155
onChange(stringValue);
156
- }, [value]);
+ }, [value, length]);
157
158
159
if (typeof pValue !== 'string') return;
0 commit comments