carbon icon indicating copy to clipboard operation
carbon copied to clipboard

MultiSelect: Show selected items in the MultiSelect itself

Open adamalston opened this issue 3 years ago • 8 comments

Summary

Show selected items in a MultiSelect field removing the need to open the dropdown to see what is selected.

Justification

Users and engineers have requested this feature in alpha and beta testing.

If a MultiSelect is disabled and there are items within that are selected, how is a user supposed to know what those items are?

Desired UX and success metrics

Template: Template

Concept (expanded): concept-expanded

Concept (collapsed): concept-collapsed

Obviously the design in this concept may need to be changed but the functionality is there - the selected items are shown within the field itself without the need to expand the dropdown to see what is selected.

To generate this concept I put in a workaround to concatenate the display names of the selected items into a label:

const label = initialSelectedItems
  .map((item: MultiSelectItem) => item.display)
  .join(', ');

return <MultiSelect label={label} initialSelectedItems={initialSelectedItems} ... />;

Required functionality

No response

Specific timeline issues / requests

Yes, this request is related to an upcoming release which I probably cannot detail here.

Available extra resources

The images above.

Code of Conduct

### Tasks
- [ ] https://github.com/carbon-design-system/carbon/issues/13435
- [ ] MultiSelect (selected items in field): implementation
- [ ] MultiSelect (selected items in field): website docs
- [ ] MultiSelect (selected items in field): figma kit

adamalston avatar Jan 05 '22 20:01 adamalston

@adamalston Thank you for making this proposal! Would you be able to provide some user scenarios of when a Multiselect would be disabled but would have items selected?

abbeyhrt avatar Jan 10 '22 16:01 abbeyhrt

Here is a screenshot from an existing UI of a field that is read only - all of the options are disabled and some of them are selected by default: user interface

This field is represented in Carbon using a MultiSelect with all options disabled and some selected by default.

adamalston avatar Jan 10 '22 19:01 adamalston

@abbeyhrt if this proposal gets accepted, I made a PR for it, still may need some testing and unit test but seems to be possible, feel free to take a look if this is even needed ~https://github.com/carbon-design-system/carbon/pull/10389~ https://github.com/carbon-design-system/carbon/pull/10446

TannerS avatar Jan 12 '22 06:01 TannerS

Thanks for making this proposal. Our team will have to review and do more visual research on this.

thyhmdo avatar Feb 07 '22 16:02 thyhmdo

Yes, please. The current implementation which only displays the number of selected items without displaying the selected items can certainly be improved. This proposal may not be viewed as 100% but it's certainly on the right track.

jt-helsinki avatar Dec 06 '22 07:12 jt-helsinki

Allow me to suggest that rather than showing the number as a tag, show each selected item as a separate tag with its own delete icon. This then works like so many tag selection UIs (e.g. Stack Overflow)

n8allan avatar Jan 31 '23 21:01 n8allan

Just wanted to share that a request for this came up in a (totally unrelated) feedback session I was running today — and I'm so happy to find out that it's being acivevly worked on. 🎉 The proposed solution in Figma (below) is exactly what I was looking for. Thanks team!

Screenshot 2024-02-20 at 2 48 15 PM

caseyg avatar Feb 20 '24 19:02 caseyg

This could be a possible solution to this problem: https://github.com/carbon-design-system/carbon/issues/16120#issuecomment-2038075215

Reference screenshot from website: image


ℹ️ Note:

  • This solution solves the visibility issue
  • This solution doesn't allow to dismiss selected options as shown in a possible solution here.

alina-jacob avatar Apr 04 '24 19:04 alina-jacob