-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add userValid
to ValidityState
#8938
Comments
This would require #8452 to be fixed first. |
I don't think this makes sense to be part of |
Also, thinking about this more, why wouldn't using |
Maybe it would make sense to separate out the "user has modified it" bit and expose that on the form element itself? |
Couldn't you say the same about |
@jimmyfrasche yeah, #9639 tracks that idea. @jacobrask you can and sometimes people do. I think we could consider adding |
@annevk that's for adding a way to set the "user has interacted" but for FACE but I don't see any mention of exposing it on form elements in general. I think it should just be exposed as |
That's fair. I guess a boolean getter for that is a reasonable solution as well and simpler. |
CSS Selectors 4 defines the
:user-invalid
and:user-valid
pseudo classes, that apply to an element after the user has significantly interacted with it [user-pseudos].:user-invalid
and:user-valid
were selected for Interop 2023.These values are currently not exposed by the constraint validation API.
ValidityState.valid
matches the state of the:valid
selector, but there is nothing for the corresponding:user-valid
selector.When implementing form validation you currently need to keep track of the "touched" status of a form element manually, to avoid showing validation errors before a user has interacted with the form. Adding
ValidityState.userValid
would let you defer the meaning of "significant user interaction" to the browser and have it be consistent with the behaviour of the:user-valid
CSS selector.The text was updated successfully, but these errors were encountered: