-
Notifications
You must be signed in to change notification settings - Fork 27
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
:user-invalid
& :user-valid
browser support
#178
Comments
Looks like this is supported in Firefox, and these are the implementation bugs for Chromium and WebKit: (Linked in BCD in mdn/browser-compat-data#17930.) |
I wonder if whoever implemented these in Firefox can help out with whatwg/html#8452 as it's not clear how they work in terms of HTML. Selectors doesn't dictate the rules for host languages after all. |
Seems like @emilio did the Gecko implementation. |
I mostly rejiggered
|
I think for this to be part of Interop 2023 someone would have to turn that into a PR against the HTML Standard. A lot of it looks somewhat straightforward, but some of the state keeping and when to invalidate that state might be tricky I suppose. And yeah, I suspect that for form-associated elements we need to reconsider when they would apply. |
In the State of CSS 2022 question about browser incompatibilities, there was one mention of (I'm commenting on all proposals where I could find some mention at all in State of CSS results.) |
In the MDN short survey on CSS & HTML, "CSS |
I agree with this comment. It's tough to tell what the standardized behavior is or should be for this. E.g. there seems to be a lot of flexibility built into this sentence:
@emilio would it be possible to expand on your comment just a bit to summarize the behavior itself? |
Thank you for proposing We are pleased to let you know that this proposal was accepted as part of the Custom Properties focus area. You can follow the progress of this Focus Area on the Interop 2023 dashboard. For an overview of our process, see the proposal selection summary. Thank you for contributing to Interop 2023! Posted on behalf of the Interop team. |
@foolip Just to confirm, this is unrelated to gradients |
@brandonmcconnell sorry, of course, that was copypasta. |
Description
Quoting the specification:
Rationale
There has been plenty of discussions and workarounds supporting this for over a decade now (or at least as far back as I can remember)— not so much the pseudo itself so much as clunky methods to accomplish what this pseudo would provide effortlessly.
markAsTouched
,markAsUntouched
,markAsDirty
,markAsPristine
→ https://angular.io/api/forms/AbstractControlOftentimes, we want to validate/invalidate form data, but we don't want to show the field as valid or invalid until after the first change event so the user has a chance to interact with the form field before the page applies successful/failure styling to the element.
Specification
https://w3c.github.io/csswg-drafts/selectors-4/#user-pseudos
Tests
:user-invalid
: https://wpt.fyi/results/css/selectors/user-invalid.html?label=master&label=experimental&aligned&view=subtest&q=user-invalid:user-valid
: https://wpt.fyi/results/css/selectors/user-valid.html?label=master&label=experimental&aligned&view=subtest&q=user-validThe text was updated successfully, but these errors were encountered: