Comments (3)
Hi @ajusa,
Actually, before this commit (d49c7ff), Pico was using :invalid
. Precisely one year ago.
The problem is that the fields are :invalid
before the form submission and before the user enters any text.
https://codepen.io/picocss/pen/vYJxvdJ
We can find solutions with complex selectors like input:required:focus:valid
or input:not(:placeholder-shown):invalid
.... but it's always a bit hacky and very opinionated.
At least, aria-invalid="false"
and aria-invalid="true"
give some control to developers.
To have a fine control of the forms validation, it is often necessary to add some javaScript.
from pico.
Got it, thanks for the response! I've only been using pico for the last few months, and was wondering why it wasn't using the built-in validation selectors. That reasoning makes perfect sense!
from pico.
Hello! I would like to revisit this issue. :user-valid and :user-invalid are both widely available in modern browsers and are only applied once the user has interacted with the element - that should eliminate the issue above and remove the requirement for JavaScript twiddling and noodling
See: https://developer.mozilla.org/en-US/docs/Web/CSS/:user-invalid#browser_compatibility
from pico.
Related Issues (20)
- Use `button` instead of `a` for closing modals HOT 8
- Cards (`<article>` tags) have poor contrast with background in light mode HOT 2
- Grid with inputs has incorrect gap on mobile devices HOT 3
- Modal component is relying too much on Javascript HOT 9
- Input shadows are offset incorrectly in Firefox HOT 2
- Unable to use on Hugo v0.122.0 via Dart Sass HOT 5
- SassError: "This variable was not declared with !default in the @used module" HOT 3
- v2: inconsistent switch states HOT 5
- Spinner not fully visible in the `<code>` element HOT 1
- `nav li button[type="button"]` does not have smaller padding HOT 1
- node version restriction HOT 7
- Inconsistent width with role=group HOT 1
- Buttons with overflowing alpha-numeric text do not wrap HOT 1
- Unhandled overflow behaviour on dropdown LI elements
- Detected Trojan:Script/Wacatac.B!ml in latest downloads HOT 4
- Accordion within Card footer is vertically not aligned.
- Inputs in dropdown are not accessible via keyboard nav
- `<a role="button">` is not vertically aligned with `<button>` in `<nav>` HOT 1
- Table has unexpected background color when in `<article>` in dark theme
- Dropdown is not vertically aligned with `<a>` in `<nav>` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pico.