-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Pattern validation with ngModel causes browser freeze on repeated input #12753
Comments
I think it's just inefficient regexp because I cannot reproduce it using different email regexps from the web. For example http://plnkr.co/edit/pFsXDwh5DeHS2551rzAK?p=preview |
This regex is not inefficient, it is accurate. The regex you pick validates |
Yeah, you're right. Probably we need to debounce input. |
The regexp is inefficient - o(n^2) http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016 |
Okay fine, it is ineficcient. But don't you think you should still debounce input ? If not a suboptimal regexp, it would be something else next time. |
Please submit an other feature request if this has not been reported yet. (I close this one because the report is not about debouncing) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a ... (check one with "x")
Current behavior
Having a text input bound with ngModel and a pattern validation, if you hold a letter key while focusing the input to enter a long string such as "aaaaaaaaaaaaa", after ~30 characters the browser freezes and does not respond anymore.
Expected behavior
Angular should prevent browser to freeze when spamming input on a field with complex validation.
Minimal reproduction of the problem with instructions
See http://plnkr.co/edit/ydMZGGQOh62fGwbLh0Yg?p=preview
What is the motivation / use case for changing the behavior?
You don't want browser to freeze or crash because of Angular
Please tell us about your environment:
Windows 7 64 bit
Language: all
Node (for AoT issues):
node --version
=The text was updated successfully, but these errors were encountered: