-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Customizable <select>
element
#9799
Comments
@whatwg/forms |
This comment was marked as spam.
This comment was marked as spam.
Thank you for bringing this proposal to the WHATWG Joey! I thought this would be a good opportunity to outline how colleagues and I feel about extending HTML in this area. In particular, we feel that new and existing form controls:
We understand that the (Aside: #5791 seems very related to this issue.) |
I think the explainer doesn't explain the need for a new element in a convincing way, because the multiple examples look addressable in the context of (From off-explainer examples, I gather that the ambition level of the feature is much higher than the explainer makes appear.) |
Thanks for taking a look and discussing with colleagues Anne!
If we made appearance:none or a new appearance value like appearance:base as discussed here and here have a standardized style, then the default appearance:auto appearance could look the same as OS controls. That would be up to each UA to decide, as it is currently for all other form controls.
Agreed! Styleability is the primary driving use case for the current proposal.
Agreed! Domenic left some feedback in this vein and we completely revamped the proposal to use existing HTML element patterns by using new tag names instead of slot and behavior attributes.
Agreed! Existing elements conform to this by letting the browser/OS provide a native picker which unfortunately can’t be styled or customized by web developers, right? It was recommended that we let the browser use native pickers for selectlist on mobile here. Ideally developers would be enabled to make their own pickers that work on these platforms when they want to as well.
Agreed! This is also a core requirement for the proposal. I have been working closely with accessibility experts participating in OpenUI to ensure that the accessibility mappings and keyboard behaviors follow the current best practices in ARIA.
Agreed! The content is fully customizable/replaceable, so it should be localizable and internationalizable, right? The only thing I can think of is supporting right-to-left and vertical writing modes when rendering where the listbox popup goes, which is something we are doing for other form control elements and we can easily do via Anchor Positioning for selectlist. Is there anything else you had in mind here?
It sounds like yall would prefer to reuse the existing
I agree that duplication should be avoided. Selectlist is not a complete duplicate of select. |
Thanks for the feedback! I am improving the examples here: openui/open-ui#918 |
I just wanted to point out Windows doesn't provide flag emojis so this specific example is a good use case for needing images not emoji. |
If you use
For It would also have the benefit of having a consistent design with (There are some challenges here with how to match these options and their elements from CSS, but that seems like a surmountable problem.) I haven't looked at survey in detail, but I'd assume that if |
I’ve been discussing with @annevk and @pxlcoder about how to move forward here, and we have reached agreement on some things. Please correct if I misrepresent anything!
|
I'm concerned by the implications of the multiple attribute. How does it work with the new parsing? That being said I am excited by the progressive enhancement possibilities. |
@annevk The majority you cannot and it isn't solely about styling but also extending them. While
@josepharhar @annevk so will this likewise have the child of |
The idea (as I see it) is to still have a The UA shadowroot will certainly adapt if and when needed to support slotting in and replacing the default button and listbox. Does that answer your question? I'm not sure if I understood it well. |
As per the spec discussion, we are going to allow <button>s in <select> to replace the opener button and <datalist>s in <select> to replace the listbox instead of creating a <selectlist> element. whatwg/html#9799 Bug: 1511354 Change-Id: If2ee766c57faf655ab31c6714be7fd682efcc177
As per the spec discussion, we are going to allow <button>s in <select> to replace the opener button and <datalist>s in <select> to replace the listbox instead of creating a <selectlist> element. whatwg/html#9799 Bug: 1511354 Change-Id: If2ee766c57faf655ab31c6714be7fd682efcc177
As per the spec discussion, we are going to allow <button>s in <select> to replace the opener button and <datalist>s in <select> to replace the listbox instead of creating a <selectlist> element. whatwg/html#9799 Bug: 1511354 Change-Id: If2ee766c57faf655ab31c6714be7fd682efcc177
As per the spec discussion, we are going to allow <button>s in <select> to replace the opener button and <datalist>s in <select> to replace the listbox instead of creating a <selectlist> element. whatwg/html#9799 Bug: 1511354 Change-Id: If2ee766c57faf655ab31c6714be7fd682efcc177
As per the spec discussion, we are going to allow <button>s in <select> to replace the opener button and <datalist>s in <select> to replace the listbox instead of creating a <selectlist> element. whatwg/html#9799 Bug: 1511354 Change-Id: If2ee766c57faf655ab31c6714be7fd682efcc177
Adding agenda+ to move this to stage 1 |
I updated the explainer to be |
We have discussed the stage 2 entrance in the last 2 triage meetings, and we have 2 implementers supporting and no strong implementer objections. This is sufficient for advancing to the next stage, but we agreed to wait for next week's meeting for an explicit signal from WebKit, since they didn't attend today's meeting. |
The `<selectedoption>` element is part of the customizable `<select>` proposal: whatwg#9799 It allows authors to declaratively clone the contents of the currently selected `<option>` of a `<select>` and style it independently for use in a base appearance `<select>`'s button. The timing of cloning has been discussed here: whatwg#10520 The selectedoption element has been discussed generally here: w3c/csswg-drafts#10242
All of the HTML spec changes for this feature are ready for review:
Edit: I'm now keeping a more up to date list in the issue description |
I recreated the [original PR](w3c/html-aam#566) by @josepharhar The `<selectedoption>` element is part of the [customizable select feature](whatwg/html#9799) and is being added to HTML [here](whatwg/html#10633). ## Implementation * WPT tests: web-platform-tests/wpt#45096 * Implementations (link to issue or when done, link to commit): * WebKit: TODO * Gecko: TODO * Blink: https://chromium.googlesource.com/chromium/src/+/18b5eac27b14b409503aa8047cf9358082a0e0df Co-authored-by: Joey Arhar @josepharhar
Adding agenda+ to ask for stage 3. I updated the issue description with the complete list of PRs needed for this feature. The semantics offered by these PRs is what we'd like to measure consensus on at the next meeting. |
This proposal includes parser, styling, and rendering changes to make the
<select>
element fully customizable by authors.Explainer: https://open-ui.org/components/customizableselect
Spec PRs:
<select>
parser #10557<selectedcontent>
element #10633CSS spec PRs:
Related HTML issues:
<selectedoption>
element #10520Related CSS issues:
<selectedoption>
element for<select>
w3c/csswg-drafts#10242<select>
stylability w3c/csswg-drafts#10333::picker(select)
match:popover-open
? w3c/csswg-drafts#10775<select>
w3c/csswg-drafts#10857<select>
w3c/csswg-drafts#10908<select>
w3c/csswg-drafts#10909The text was updated successfully, but these errors were encountered: