Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional characters #4

Open
mdodge-ecgrow opened this issue Nov 16, 2023 · 1 comment
Open

Optional characters #4

mdodge-ecgrow opened this issue Nov 16, 2023 · 1 comment

Comments

@mdodge-ecgrow
Copy link

Does this library support optional characters? For instance a US zip code is usually in format 99999 but sometimes can be in format 99999-9999.

@mdodge-ecgrow
Copy link
Author

I looked at the options and initially thought the charRegex option allowed me to type in my own mask regex, like this:

const { getInputProps: zipCodeInput } = useInputMask({
	charRegex: /^\d{5}(?:-\d{4})?$/
});

But upon further looking, it looks like that option only sets the allowable characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant