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

fix(input): mark as touched on blur #2119

Merged

Conversation

andrew-frueh
Copy link
Collaborator

force an input element to mark its ngControl as touched on blur

@JDavidStevens @corykon - this was an interesting one because it happens in Chrome but not Firefox. The issue is that the ngControl on our inputDirective isn't being marked as touched on blur (or it's happening after the blur event). And with our validation step, it won't mark the control as invalid unless it's been touched. So what I've done here is force the control to be marked as touched on blur (which it should be doing anyway) before the validation gets called. With that change, the test you mentioned checks out.

closes #2116

force an input element to mark its ngControl as touched on blur

closes HealthCatalyst#2116
@andrew-frueh andrew-frueh requested a review from corykon April 10, 2023 18:40
Copy link
Collaborator

@corykon corykon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's so odd. Did you find stuff online that mentioned this difference across browsers?

@andrew-frueh andrew-frueh merged commit cfe5802 into HealthCatalyst:dev Apr 10, 2023
@andrew-frueh andrew-frueh deleted the chrome-input-validation branch April 29, 2023 20:25
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

Successfully merging this pull request may close these issues.

Input Field Validation is Delayed
2 participants