Skip to content
New issue

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

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

Already on GitHub? # to your account

Restrict input chars #1

Closed
kleinph opened this issue Jun 14, 2023 · 4 comments
Closed

Restrict input chars #1

kleinph opened this issue Jun 14, 2023 · 4 comments

Comments

@kleinph
Copy link

kleinph commented Jun 14, 2023

Feature Request: make it possible to specify the allowed characters for the input, like numbers or letters.

See also issue in cleave.js: nosir/cleave.js#680

Thanks

@lekoala
Copy link
Owner

lekoala commented Jun 15, 2023

here you go
https://github.com/lekoala/cleave-es6/releases/tag/1.0.1

@kleinph
Copy link
Author

kleinph commented Jun 15, 2023

Thanks for the quick implementation!

Did a quick test and found a bug: when a string with unallowed chars is pasted into the input no formatting is applied.
Since I couldn't find a demo with the allowedChars property, I made a small reproducers: https://stackblitz.com/edit/js-5dbedx

@lekoala
Copy link
Owner

lekoala commented Jun 16, 2023

@kleinph
Copy link
Author

kleinph commented Jun 17, 2023

Thanks, it seems fixed now.

@kleinph kleinph closed this as completed Jun 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants