Open josepharhar opened 1 month ago
ios has a button which says how many items are selected, not sure how good that is though.
This website also has a select multiple which creates buttons for each selected option inside the button. I think it would be very challenging to try to get something like this standardized. This also looks like something that greg was looking into for combobox?
The above mentioned website design is how we designed (one version of) our multi select. (Scott please forgive us for the input inside the picker UI 👀.)
Chrome Android also does a button that says how many items are selected and then has a dialog that opens. But if one item is selected it displays that in the button.
Firefox android has an awkward Inbetween where it renders as a listbox but when you press it it loads a dialog.
Imo an in-page listbox is a separate component that should be able to be single or multi selectable. One of our other versions of multi select used a dual listbox approach where it would be desirable to embedded in the page.
The default multi select should be a button with a drop down imo. We should also try to standardise something like the iOS/chrome android approach. Or perhaps we can try render the selected options as flex items within a <selectedoptions>
element, that can be styled? More complicated designs such as a close button or being able to deselect by clicking on the tags will require JavaScript to do and probably fall foul of content model guidelines because nested interactivity?
The default multi select should be a button with a drop down imo. We should also try to standardise something like the iOS/chrome android approach.
@lukewarlow I agree that this is the most known pattern when looking at external design systems. What do you mean with standardise iOS/android approach?
Isn't this idea to make it fully customisable and then if desired opt-out via CSS again to show native controls if desired? I think CSS style queries could help with further detection in the future, but unfortunately this is currently only usable on custom properties. I might be reading this wrong :)
ios has a button which says how many items are selected.
I mean have this as the default button contents.
The Open UI Community Group just discussed Does `<select multiple>` need a button and popup by default?
.
I've removed the agenda label but it doesn't look like there was a resolution to this
nope. no resolution.
select multiple
could be a design / updated allowances for children of options (e.g., they can include images) - but otherwise work similar to the current select multiple
and allow for the listbox to be rendered as an inline / non-popup element. arguably people could then use script to identify their chosen options and make their own multi-select popup using button/popover.
or select multiple
works similarly to the use cases mentioned in this thread, where it's a multi-select popup that's rendered. a few open questions then being:
I think it's worth a discussion on whether we need an embed Vs popup option more generally than select multiple. Because that might sway what we end up doing here.
All good points Scott, making it a popup is going to be hard.
does a multi-select as a popup actually reuse / repurpose the multiple attribute? wouldn't that be weird if multiple did one thing for classic select, but for styled select it behaves differently?
One idea I had in mind for this was to use the size attribute to differentiate popup vs in-page since that already happens for single-select, but most mobile browsers already change <select multiple>
to use a popup without any other opt in which is different from desktop, so the situation is already a bit messed up.
In my mind, the big complication with doing appearance:base for select multiple is that there's not a clear and easy way to represent multiple selected options in the button.
If we follow what browsers already do by having an in-page listbox for select multiple, it would be really easy to go forward with multi selects.
Do most use cases for multi-select have a button? Is it important? If so, what should be in the button?