Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
292 stars 75 forks source link

Enhancement: Subtitle/description for combobox-item #3695

Closed jgibson02 closed 3 months ago

jgibson02 commented 2 years ago

Description

Provide a subtitle/description prop for displaying a secondary label on a combobox-item

Acceptance Criteria

Relevant Info

Which Component

combobox-item

Example Use Case

In ArcGIS Velocity, we have a spatial reference selector which has ~9000 items, and users often are familiar with choosing a spatial reference by either the text label (e.g. "GCS WGS 1984") or by its numeric WKID (e.g. "4326"), so we used the subtitle prop that calcite-react MenuItems provide to display the numeric WKID on the menuitem, and filtering automatically filters against that subtitle as well.

image

Due to a bug in calcite-react where scrolling while using the appendToBody and virtualized props together will cause the dropdown to close, we are looking to switch to using calcite-components combobox instead, but not having this subtitle is a serious UX drawback.

macandcheese commented 1 year ago

This would probably be best implemented as a content-end slot alongside a description string prop.

hccampos commented 1 year ago

We should also have the ability to provide a value to be displayed in the input when the combobox is closed. In this spatial reference case, it could display the WKID or some other shorter representation of the spatial reference.

In our case, we bumped into this while working on a Timezone picker where we have a long name with the IANA code and the UTC offset, but we don't want to display all that information in the input itself, since it would make the input too large.

ashetland commented 1 year ago

Designs for a description prop and a content-end slot are ready to go in this Figma file. Also outlined is a proposed value-short prop to address the needs in this comment. cc @jcfranco

github-actions[bot] commented 1 year ago

cc @geospatialem, @brittneytewks

ashetland commented 1 year ago

A round of feedback has resulted in some fine-tuning to do on the abbreviated value prop and its behaviors.

ashetland commented 1 year ago

Revised designs and full context with related issues in epic #6720 are available in this Figma file.

Designs include:

Possible names:

Notes for docs:

cc @jcfranco @SkyeSeitz @macandcheese

github-actions[bot] commented 1 year ago

cc @geospatialem, @brittneytewks

SkyeSeitz commented 1 year ago

Although text-label-short is less characters (always a plus), its role may be a bit ambiguous? text-label-abbreviated or text-label-abbreviation comes with perhaps more clarity, imo.

ashetland commented 1 year ago

Although text-label-short is less characters (always a plus), its role may be a bit ambiguous? text-label-abbreviated or text-label-abbreviation comes with perhaps more clarity, imo.

Added a couple more options to the list above.

github-actions[bot] commented 4 months ago

Installed and assigned for verification.

DitwanP commented 4 months ago

🍡 Verified on 2.11.0-next.12

Screenshot 2024-07-16 at 2 50 57 PM

ashetland commented 4 months ago

Reopening issue to correct a couple small misses during design review. Design spec has been updated. cc @jcfranco

github-actions[bot] commented 4 months ago

Installed and assigned for verification.

DitwanP commented 3 months ago

🍡 Verified on 2.11.0-next.21