Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Combobox] Add an option to limit the amount of displayed chips #4326

Closed
macandcheese opened this issue Mar 29, 2022 · 9 comments
Closed

[Combobox] Add an option to limit the amount of displayed chips #4326

macandcheese opened this issue Mar 29, 2022 · 9 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. c-combobox Issues that pertain to the calcite-combobox and related components design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 13 Requires planning and input from team, consider smaller steps. p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.

Comments

@macandcheese
Copy link
Contributor

macandcheese commented Mar 29, 2022

Description

The Combobox can often become crowded when many chips are selected.

Propose to add a limitChips(name tbd) property that appends all additional chips after that numeric value to a non-dismissible "+n" chip.

Questions to answer:

  • What chips are visible - is it decided by order entered, alphabetically, etc.
  • Should there be an affordance for "no individual chips" - as in, "4 selected", 6 selected", "1 selected", etc.
    • If so, is that exclusive from this request? If not, how do they interact?
  • What happens when the combobox is interacted with - do the "+3" chips appear in-combobox? in-dropdown? nowhere?

Acceptance Criteria

As a user, I can choose a number of chips to display, after which, all selected items would be appended to a non-dismissible catch-all.

Also note of Aaron's comment

For example, limit-chips="2" would result in:

This would result in a display of <chip (1) ><chip 2 (x) ><+n>

Relevant Info

MUI's "limit tags" https://mui.com/components/autocomplete/#limit-tags

No response

Which Component

Combobox

Example Use Case

My product offers a state-selection Combobox to a user. Often times, a user can select 5+ states, which clutters the combobox and causes my UI to break. I want to limit the amount of chips displayed.

@macandcheese macandcheese added enhancement Issues tied to a new feature or request. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Mar 29, 2022
@LeviRemi
Copy link

Customer example where they dislike how other containers in the same row grow in height to accommodate the ever-expanding combobox. This layout also does not scale well for large quantities of selection.
Screen Shot 2022-03-29 at 2 20 27 PM

@LeviRemi
Copy link

One note from a customer. If you pursue the "no individual chips" option and have "# Selected" as the singular chip, please consider swapping "#" with "All" if every item in the list is selected:

"1 Selected" -> "2 Selected" -> "All Selected" on a list of 3, for example.

@macandcheese macandcheese added design Issues that need design consultation prior to development. c-combobox Issues that pertain to the calcite-combobox and related components labels Mar 20, 2023
@mMa2
Copy link

mMa2 commented Apr 6, 2023

The displayed selected chips keep growing and occupy too much real estate, hide other components on the UI, it is too crowded for the user to see other items. Please consider options as 1)shrink the display text 2) have a textbox labelled down to show selected items, no displaying chips

@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed needs triage Planning workflow - pending design/dev review. 0 - new New issues that need assignment. labels May 18, 2023
@rmstinson
Copy link

@ashetland and I met on this and discussed some ideas. Here's a link to some of the scratch work we're iterating on for discussion's sake only: https://www.figma.com/file/ujZYHdimnVC3yA2PyYOH85/Epic%3A-Combobox-Redesign?type=design&node-id=43%3A58814&t=q3Gb7wa0njY5GVwU-1

@ashetland ashetland assigned ashetland and unassigned rmstinson Jun 20, 2023
@ashetland
Copy link
Contributor

Proposing a new display-mode prop that would address the need to limit the number of chips displayed while also making Combobox a more responsive component.

Full designs and context with other issues from epic #6720 are available in this Figma file.

This property does not affect selection-mode=”single”.

displayMode Values

show-all (default)

Current behavior — Combobox grows in height to accommodate chips as items are selected.

single

Combobox displays a single chip that shows the total number of selected items or “All selected” when all items are selected. (See related designs for select-all, issue #2311.)

fit-to-line
Combobox will display chips in the order they are selected, but will not grow in height. Additional selections are added to a chip that displays the number of selected items not shown (+n). When the width is small enough to only accommodate a single chip, that chip follows the behaviors outlined in single (total number or “All selected”.)

Note

Chips that display “All selected” or “n selected” or “+n” are not closable. This is to prevent a conflict with the clear-all button.

@ashetland ashetland added the ready for dev Issues ready for development implementation. label Jul 7, 2023
@github-actions github-actions bot removed design Issues that need design consultation prior to development. 1 - assigned Issues that are assigned to a sprint and a team member. labels Jul 7, 2023
@geospatialem
Copy link
Member

There are a few remaining items needed for resolution, including tests and additional team reviews. Reallocated to the November release for inclusion. cc: @brittneytewks

@eriklharper eriklharper added estimate - 8 Requires input from team, consider smaller steps. and removed estimate - 5 A few days of work, definitely requires updates to tests. labels Nov 7, 2023
@eriklharper eriklharper added estimate - 13 Requires planning and input from team, consider smaller steps. and removed estimate - 8 Requires input from team, consider smaller steps. labels Nov 17, 2023
eriklharper added a commit that referenced this issue Nov 21, 2023
…splay prop (#7912)

**Related Issue:** #4326 

## Summary

This PR introduces a new `selection-display` property to Combobox to
control the chip display with the available values `all`(default), `fit`
and `single`. This new property only takes effect when `selection-mode`
is `multiple` or `ancestors`.

---------

Co-authored-by: Erik Harper <eriklharper@pm.me>
@eriklharper eriklharper added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Nov 21, 2023
Copy link
Contributor

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Nov 21, 2023
@geospatialem
Copy link
Member

Verified in 2.0.0-next.1 with the following Codepen for selectionMode of "ancestors" and "multiple" with selectionDisplay of "all", "fit", and "single".

image

image

benelan pushed a commit that referenced this issue Nov 24, 2023
…splay prop (#7912)

**Related Issue:** #4326 

## Summary

This PR introduces a new `selection-display` property to Combobox to
control the chip display with the available values `all`(default), `fit`
and `single`. This new property only takes effect when `selection-mode`
is `multiple` or `ancestors`.

---------

Co-authored-by: Erik Harper <eriklharper@pm.me>
benelan pushed a commit that referenced this issue Nov 24, 2023
…splay prop (#7912)

**Related Issue:** #4326 

## Summary

This PR introduces a new `selection-display` property to Combobox to
control the chip display with the available values `all`(default), `fit`
and `single`. This new property only takes effect when `selection-mode`
is `multiple` or `ancestors`.

---------

Co-authored-by: Erik Harper <eriklharper@pm.me>
benelan pushed a commit that referenced this issue Nov 26, 2023
…splay prop (#7912)

**Related Issue:** #4326 

## Summary

This PR introduces a new `selection-display` property to Combobox to
control the chip display with the available values `all`(default), `fit`
and `single`. This new property only takes effect when `selection-mode`
is `multiple` or `ancestors`.

---------

Co-authored-by: Erik Harper <eriklharper@pm.me>
@ashetland ashetland removed the figma changes Issues that require additions or updates to the Figma UI Kit where no `design` label exists label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. c-combobox Issues that pertain to the calcite-combobox and related components design Issues that need design consultation prior to development. enhancement Issues tied to a new feature or request. estimate - 13 Requires planning and input from team, consider smaller steps. p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation.
Projects
None yet
Development

No branches or pull requests