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

Prevent Invalid Character Entry - Copy and Paste #10

Open
mblasiusnyc opened this issue Jan 12, 2015 · 1 comment
Open

Prevent Invalid Character Entry - Copy and Paste #10

mblasiusnyc opened this issue Jan 12, 2015 · 1 comment

Comments

@mblasiusnyc
Copy link

Currently, you can still paste invalid characters into an input box when "preventInvalidInput: true".

@paulyoder
Copy link
Contributor

preventInvalidInput uses the keyPress event to prevent entering invalid input. After each keyPress it confirms the current key that was pressed is valid. It doesn't look at the whole value for the input box. That's why pasting in a value bypasses the prevention.

I really don't want to check the whole input value every time a key is pressed because performing regex matches can get quite expensive. If you really want to prevent the user from pasting invalid input, then I recommend creating another directive that does it and apply it to the input box.

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

2 participants