Skip to content

Commit

Permalink
fix(components): Avoid to increase inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
luffy84217 committed Feb 19, 2022
1 parent 4333ce1 commit 9a9b49e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/PinInputField.tsx
Expand Up @@ -72,7 +72,7 @@ const PinInputField: React.FC<PinInputFieldProps> = ({
const rawValue: string[] = normalizeNewValue(
currentValue,
eventValue
).slice(0, newValues.length);
).slice(0, newValues.length - index);
const regex = type === 'number' ? /(^$)|(\d+)/ : /.*/;
const shouldFireChange: boolean = rawValue.every((val) => regex.test(val));

Expand Down

0 comments on commit 9a9b49e

Please sign in to comment.