Blueprint: [MultiSelect] support closeOnSelect

Created on 16 Feb 2019  路  9Comments  路  Source: palantir/blueprint

Environment

  • @blueprintjs/select@^3.3.0:
  • __Browser and OS versions__:

Feature request

There is closeOnSelect props on suggest. Could we support it on MultiSelect too?

Examples

select feature request

Most helpful comment

In my case, I make a validation after each MultiSelect change and error dialog conflicts with a dropdown (opening of a dialog doesn't trigger onInteraction inside MultiSelect's Popover, somehow). closeOnSelect would solve my problem
Screen Shot 2019-03-28 at 20 28 05

All 9 comments

Not sure if that would be good UX... why would you want to close a multi select after only one interaction?

In my use case, it is a valid state after having one or more items been added to the multiSelect. But now users have to click somewhere else to close the multiSelect dropdown before working on something else. By having a closeOnSelect, we can save that one additional click which is quite helpful.

What if the user wants to select multiple items, since it is, in fact, a multi select dropdown? They have to endure an additional click to re-open the dropdown.

Right, then a configurable closeOnSelect could solve both of the requirements.

The idea still feels kind of unintuitive to me; are there any examples in the wild which use that UX? Most other UI kits I've seen keep the dropdown open, but it does look like react-select's multi select example closes the dropdown after one interaction.

Any thoughts @pkwi? Should we accept a PR to add this prop? Could you see a use for it in Palantir apps?

In our use case, selecting one or two items consumes 90% of the cases:

  • For the one item selection, closeOnSelect===true could save on click than closeOnSelect===false
  • For the two items selection, closeOnSelect===true has as many clicks as closeOnSelect===false
  • Only for three or more items selection, closeOnSelect===true needs more clicks than closeOnSelect===false.

So I think it is valuable to have the option of configurable closeOnSelect.

@adidahiya I doubt we will have a use for this internally. For us, it is important that items are selected/removed quickly from the list.

In my case, I make a validation after each MultiSelect change and error dialog conflicts with a dropdown (opening of a dialog doesn't trigger onInteraction inside MultiSelect's Popover, somehow). closeOnSelect would solve my problem
Screen Shot 2019-03-28 at 20 28 05

+1 on the last comment, onInteraction isn't sufficient for third parties who want to support good UX for single selection use cases.

We have a Select component backed by BP's MultiSelect, but it accepts single or multiple selections. We want to be able to closeOnSelect in the single case, but there's no such prop. Furthermore, we can't control the popover state entirely because onInteraction doesn't account for the Esc key being pressed or the target being blurred, which causes issues for keyboard users.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shahzeb1 picture shahzeb1  路  3Comments

scottfr picture scottfr  路  3Comments

tgreenwatts picture tgreenwatts  路  3Comments

havesomeleeway picture havesomeleeway  路  3Comments

havesomeleeway picture havesomeleeway  路  3Comments