Reputation: 3320
How can I create a mask via react-text-mask that can have only 14 digits?
Something like this:
export default function NumberMask(props) {
const { inputRef, ...other } = props;
return (
<MaskedInput
{...other}
ref={(ref) => {
inputRef(ref ? ref.inputElement : null);
}}
mask={[?? , '______________']}
placeholderChar={'\u2000'}
size={14}
showMask
/>
);
Upvotes: 0
Views: 261
Reputation: 1547
As a regular expression
/\d{14}/g
regarding react-text-mask I guess
mask={[/\d{14}/]}
Upvotes: 1