Re: [csswg-drafts] [selectors-4] Issue 11: Introduce pseudo-class matching when user changed the value of an input (#1533)

Thanks! On a quick read I failed to see that `:is(:user-valid, :user-invalid)` was an actual selector and not an enumeration of the `:is(:user-valid)` and `:is(:user-invalid)` selectors.

You are right that `:is(:user-valid, :user-invalid)` covers all "significantly interacted with" elements, but there is at least one drawback which makes it incompatible with `:dirty`:

https://drafts.csswg.org/selectors-4/#user-pseudos also says:
> For example, the input in the following document fragment would match '':invalid'' as soon as the page is loaded (because it the initial value violates the max-constraint), but it won't match '':user-invalid'' until the user significantly interacts with the element, or attempts to submit the form it's part of.
```HTML
<form>
    <label>
        Volume:
        <input name='vol' type=number min=0 max=10 value=11>
    </label>
    ...
</form>
```
Basically the `:is(:user-valid, :user-invalid)` would kick in on form submit even if there was no interaction with the elements.

This being said, there probably is a combination of `:user-valid`, `:user-invalid`, `:valid`, `:invalid` that would do the job for each of the most common real-life use-cases, but I would still prefer the more straightforward `:dirty` 😀 

-- 
GitHub Notification of comment by zoliszabo
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1533#issuecomment-1148516014 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 June 2022 11:01:58 UTC