Skip to content

[css-forms-1] Apply display-visibility to hide unchecked options inside <selectedcontent> #14941

Backlog

Description

@fantasai

For multi-select, the <selectedcontent> element clones all of the <option>s of the element, and "and by default only the copies that match :checked are rendered".
(See HTML definition and rendering.)

This is currently implemented using the display property. However, like the [hidden] attribute previously, this creates a cascade hazard: if the author tries to select <option> to change its display type (for example, option { display: grid; }), this will cause the unselected <option> elements to all appear inside <selectedcontent>.

We recently adopted a new display-visibility property to be able to sidestep such cascade hazards. Let's use it for selectedcontent > option. This will solve the cascade hazard, and by doing so will not only greatly improve usability for authors, but may even make it possible for us to adopt the <option>-cloning model into single-select.

Activity

  1. astearns commented on Dec 3, 2026

    @astearns
    Member

    Like the discussion we had about relying on a notional currentBackgroundColor for ::picker() colors, I think we should get display-visibility fully specified, implemented, tested, and reviewed by ARIA, TAG, etc. before we make any decisions on where to start relying on it.

  2. josepharhar commented on Dec 4, 2026

    @josepharhar
    Contributor

    Sounds good to me.

    Besides the author hazard, is this intended to make it so that the width of the select element can be consistent regardless of whichever option(s) are selected? I still kind of think that we should re-enable intrinsic inline sizing for base appearance select elements with no author replaced button so the width thing in my previous sentence also works for the no author button case: #11838 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions