Repository navigation
Conversation
|
I see your point, but I'm not sure if only on focus is necessarily the solution. On the flip side, maybe it's good enough when combined with :user-invalid so that a more desirable behavior will automatically appear in the future. |
I checked it already: user-invalid works only in Firefox :( |
Co-authored-by: Frans de Jonge <[email protected]>
Co-authored-by: Frans de Jonge <[email protected]>
Frenzie
left a comment
There was a problem hiding this comment.
lgtm, unless we want to involve some script
Right now this only works completely as intended in the latest versions of Firefox, but other browsers will presumably implement it in the near future.
|
I suggest we wait a bit to see this syntax implemented in one more browser or moved from draft to Candidate Recommendation (CR) at least |
|
The status is for the whole document, but if you prefer. |
|
closed. I still hate the red borders. |
Every theme styled required inputs and selects with :invalid, which matches as soon as an empty required field renders, before the user has even touched it. This made fields such as the username on the "Add user" admin form show a red border on first load, with nothing wrong yet. Switch to :user-invalid, which only matches after the user has interacted with the field (e.g. on blur or submit), so a field only turns red once it is actually flagged as invalid by the user's own input. Browser support for :user-invalid is now good enough across evergreen browsers (~89%, per caniuse) for this to be safe, which was the blocker that stopped a previous attempt at this fix in FreshRSS#3724. Fixes FreshRSS#3647
* Use :user-invalid instead of :invalid for form field styling Every theme styled required inputs and selects with :invalid, which matches as soon as an empty required field renders, before the user has even touched it. This made fields such as the username on the "Add user" admin form show a red border on first load, with nothing wrong yet. Switch to :user-invalid, which only matches after the user has interacted with the field (e.g. on blur or submit), so a field only turns red once it is actually flagged as invalid by the user's own input. Browser support for :user-invalid is now good enough across evergreen browsers (~89%, per caniuse) for this to be safe, which was the blocker that stopped a previous attempt at this fix in #3724. Fixes #3647 * CSS: support legacy Gecko invalid styles * Drop legacy -moz-ui-invalid Not important enough --------- Co-authored-by: Gerard Alvear <[email protected]> Co-authored-by: Alexandre Alapetite <[email protected]>
Closes #3647
Changes proposed in this pull request:
How to test the feature manually:
(tested with Firefox 90 and Microsoft Edge on Windows 10)
Pull request checklist: