Coder Social home page Coder Social logo

Comments (5)

facelessuser avatar facelessuser commented on July 17, 2024

It seems an example has been added over at the CSS drafts page: https://drafts.csswg.org/selectors-4/#placeholder. It mentions:

For example, according to the semantics of [HTML] the placeholder attribute on the input element provide placeholder text, as does the first option element of a select under certain conditions. The :placeholder-shown class thus applies whenever such placeholder text is shown.

So does this mean they are just going to make :placeholder-shown select the select case? If so, that makes more sense than adding :placeholder-select. We'll wait and see how this progresses.

from soupsieve.

facelessuser avatar facelessuser commented on July 17, 2024

Looking back at the level 4 spec, it appears they mean for :placeholder-shown to also represent certain option elements under select as specified in the HTML spec:

If a select element has a required attribute specified, does not have a multiple attribute specified, and has a display size of 1; and if the value of the first option element in the select element's list of options (if any) is the empty string, and that option element's parent node is the select element (and not an optgroup element), then that option is the select element's placeholder label option.

This is a new requirement, and I don't think any browsers actually implement new part of :placeholder-shown yet. So this isn't high priority, but something we should look into.

from soupsieve.

facelessuser avatar facelessuser commented on July 17, 2024

I will probably wait to see when other browsers implement this. Unfortunately, the csswg takes a looooong time to settle on things and back pedal on things, and if browsers never implement it, stuff gets dropped. It's been years and level 4 still isn't finalized. I may be slower to implement things that browsers aren't implementing moving forward.

from soupsieve.

facelessuser avatar facelessuser commented on July 17, 2024

If/when we decide to pull the trigger on this, this would essentially get us what we want: https://github.com/facelessuser/soupsieve/tree/feature/placeholder-shown-select.

from soupsieve.

facelessuser avatar facelessuser commented on July 17, 2024

This functionality seems to have been moved to :blank in the spec. Closing as it seems this will not be relevant to :placeholder-shown.

from soupsieve.

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.