这是indexloc提供的服务,不要输入任何密码
Skip to content

Change definition of select element list box and drop-down box rendering #11460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josepharhar
Copy link
Contributor

@josepharhar josepharhar commented Jul 16, 2025

This PR allows select elements with the multiple attribute to be rendered as a drop-down box when the author explicitly sets the size attribute to 1.

The related issue should be resolved by requiring that mobile browsers and desktop browsers both follow these rules in order to improve cross-platform compatibility.

Fixes #8189

(See WHATWG Working Mode: Changes for more details.)


/form-elements.html ( diff )
/rendering.html ( diff )

This PR allows select elements with the multiple attribute to be
rendered as a drop-down box when the author explicitly sets the size
attribute to 1.

The related issue should be resolved by requiring that mobile browsers
and desktop browsers both follow these rules in order to improve
cross-platform compatibility.

Fixes whatwg#8189
@josepharhar
Copy link
Contributor Author

This PR implements the plan I wrote in this issue: #8189

The UseCounter data I've collected so far looks OK, but this change might not end up being web compatible. Before I try shipping this and finding out, I'd like feedback on this from Apple and Mozilla.

@mtrootyy
Copy link

The following changes are also required:

4.10.7 The select element
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.

If a select element has a required 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.

Aria in HTML(https://w3c.github.io/html-aria/)
select (with NO multiple attribute and NO size attribute having value greater than 1)

select (with NO size attribute having value greater than 1)

select (with a multiple attribute or a size attribute having value greater than 1)

select (with a size attribute having value greater than 1)

@josepharhar josepharhar changed the title Change definition of list box and drop-down box rendering Change definition of select element list box and drop-down box rendering Jul 23, 2025
josepharhar added a commit to josepharhar/html-aria that referenced this pull request Jul 23, 2025
In this HTML PR I am planning on changing the definition of how combobox
vs listbox rendering is done with size and multiple attributes:
whatwg/html#11460

This PR defers to the HTML definition of display size which defines
combobox vs listbox rendering based on multiple and size attributes.
@josepharhar
Copy link
Contributor Author

Thanks @mtrootyy, I updated that section and opened an aria PR: w3c/html-aria#555

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

Successfully merging this pull request may close these issues.

Rendering <select> as a listbox is a one-line widget that opens a popup on iOS and Android
2 participants