Skip to content

[Select] Allow adding non-option children #26356

Open
@Floriferous

Description

Many of our first-time users get confused by multi-selects, as they don't often quickly understand that they need to click outside of the select menu to close it so they can continue filling in their form. This makes onboarding new users with multi-selects a bit uncomfortable.

We'd like to add a visible button to the Menu that lets them close it, however it seems like this isn't trivial to do, as all the children of the Menu trigger the handleItemClick function, adding undefined to the array of values.

Here's an example of what I'm trying to achieve, another option would be to have an IconButton top-right that's clickable for example:
https://codesandbox.io/s/dry-wind-jdfbe

Screenshot 2021-05-18 at 10 26 11

As you can see in the demo, the "Close" label is added to the values array as undefined.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Metadata

Assignees

No one assigned

    Labels

    component: selectThis is the name of the generic UI component, not the React module!new featureNew feature or requestwaiting for 👍Waiting for upvotes

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions