Skip to content

HTML select element: code explanations and tech summary#43714

Merged
chrisdavidmills merged 4 commits intomainfrom
estelle-patch-7
Apr 9, 2026
Merged

HTML select element: code explanations and tech summary#43714
chrisdavidmills merged 4 commits intomainfrom
estelle-patch-7

Conversation

@estelle
Copy link
Copy Markdown
Member

@estelle estelle commented Apr 8, 2026

Add code explanation in example sections. (moved from actual code and results areas)
Updated text for clarity and corrected minor errors in the examples section. ARIA role match spec: https://w3c.github.io/html-aria/#el-select
ordered see also

Add code explanation in example sections.
Updated text for clarity and corrected minor errors in the examples section.
ARIA role match spec: https://w3c.github.io/html-aria/#el-select
@estelle estelle requested a review from a team as a code owner April 8, 2026 17:10
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed labels Apr 8, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

Preview URLs (1 page)

(comment last updated: 2026-04-09 12:50:31)

Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly makes sense, thanks @estelle. I've just got a few suggestions for you to look over.

<ul>
<li>The select {{htmlelement("button")}} is optionally included as a child <code>&lt;button&gt;</code> element with a nested {{htmlelement("selectedcontent")}} element.</li>
<li>The drop-down picker is defined as any other content, which can include zero or more <code>&lt;option&gt;</code>, <code>&lt;optgroup&gt;</code>, <code>&lt;hr&gt;</code>, {{htmlelement("div")}}, {{htmlelement("script")}}, {{htmlelement("template")}}, and {{htmlelement("noscript")}} elements.
<li>{{HTMLElement("option")}}, {{HTMLElement("optgroup")}}, or {{HTMLElement("hr")}} elements, optionally preceded by a {{htmlelement("button")}} element with a nested {{htmlelement("selectedcontent")}} element if a drop down box.</li>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you felt this change was necessary. It is my understanding that the permitted content differs when you've opted into customizable select rendering using appearance: base-select.

It could probably still do with a bit of a change to clarify that the dropdown picker is not always a thing (when you are dealing with ), but I still thought it was useful.

Copy link
Copy Markdown
Member Author

@estelle estelle Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

future proofing. there is no legacy select in the spec anymore. Adding the newer features doesn't break any functionality of a select in browsers that don't support the button. This means the button is optional; it's still a select with or without a button. The customizing part is a CSS thing. You can add a button with no effect. the appearance: base-select is the magic sauce.

Basically, making this match the spec rather than making it match how a new feature is implemented, b/c soon it won't be new.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fair enough. That makes sense.

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
@estelle estelle requested a review from chrisdavidmills April 9, 2026 12:47
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle awesome, ready to merge. Lets goooooo

@chrisdavidmills chrisdavidmills merged commit dea6ca3 into main Apr 9, 2026
13 checks passed
@chrisdavidmills chrisdavidmills deleted the estelle-patch-7 branch April 9, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants