vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
449 stars 83 forks source link

"Select all" for multiselect combobox #4590

Open OlliTietavainenVaadin opened 2 years ago

OlliTietavainenVaadin commented 2 years ago

Describe your motivation

Sometimes you want to select all of the items available (or all except one, etc.). If there's more than a handful, clicking on them all is a lot of work. There should be an easier way to do that.

Describe the solution you'd like

It could be something as simple as a "select all" item in the dropdown

Describe alternatives you've considered

Maybe a "select all" button in the input?

Additional context

Lazy loading needs to be taken into account.

jouni commented 2 years ago

I feel like this could left as a responsibility of the application, to provide a button next to the combo box for selecting all.

But perhaps an extra item in the overlay would be a nice enhancement. Need to think about how to combine it with #4185

mvysny commented 10 months ago

If the button is placed to the left of the MSCB, the user will not see the list of all options and therefore can't really tell which items will be selected. On the other hand, placing the button into the dropdown overlay, above the items, the user will see the items and will see the checkboxes applied as all the items are being checked. I think the latter is a better UX.

Levaimate commented 4 months ago

Is there any news or progress for this issue? This is a function we would also like in our application without resorting to some hacky workarounds or an external button.

jorgheymans commented 1 day ago

Looking a bit at other tech, i quite liked Angular's take (https://primeng.org/multiselect) on this, it's minimal intuitive and does not disrupt layout as it's fully part of the widget

image

Another approach, is to name the first element "Select All" like in this react widget (https://www.npmjs.com/package/react-multi-select-component). I'ld say this looks more like a workaround compared to above.

image

Fully agree with @mvysny that having extra components outside of widget for this is bad UX.

(edit: and yes, we need this as well)