Skip to content

[combobox][select] List header with "Select all visible" #4927

@Stusu

Description

@Stusu

Feature request

Summary

I'd like to request support for a built-in way to render a "Select all visible" option so selecting mutlitple options can be done with 1 click on top pinned item in Combobox list.
My suggestion is to add new components - ListHeader and SelectAll so usage may look like this:

<Combobox.List>
  <Combobox.ListHeader>
    <Combobox.SelectAll />
  </Combobox.ListHeader>
  <Combobox.Collection>
  {(item) => (
    <Combobox.Item value={item}>
      {item.label}
    </Combobox.Item>
  )}
  </Combobox.Collection>
</Combobox.List>

Examples in other libraries

Prime React

Motivation

I'm trying to create a combobox with top pinned option that changes selection for all visible options.

Image

I was able to achive that behaviour with controlled api and some additional context, but I think it would be nice to have same functionality out of the box and for uncontrolled component as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: comboboxChanges related to the combobox component.component: selectChanges related to the select component.has workaroundThere’s a bug, but users have a complete workaround, so no urgent fix or release is needed.type: new featureExpand the scope of the product to solve a new problem.
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions