Giter Club home page Giter Club logo

Comments (3)

lucaslarroche avatar lucaslarroche commented on May 21, 2024

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.

ajusa avatar ajusa commented on May 21, 2024

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.

abouthalf avatar abouthalf commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.