Skip to content

Calcite 5.0: Setting .value on calcite-combobox with selection-display="fit" doesn't remove (+#) chip even when they no longer overflow or exist as selected #14222

@mjperez-usgs

Description

@mjperez-usgs

monday.com sync: #11681509793

Check existing issues

Which Component

Combobox

Actual Behavior

When using calcite-combobox in a width-limited way, and selection-display="fit", setting the .value on the combobox to a value that would be able to fit in the display doesn't remove the +# chip that appears when values have overflowed. When you open the dropdown, it clears the the + chip, showing the correct value without other changes.

In pictures:

After choosing a bunch of values, it shows the overflow as expected:

Image

After setting the value of combobox to the value of 'Item 2', it incorrectly shows a bunch of overflow, but does show Item 2 is selected (it is the only one that is):

Image

Opening the dropdown shows that only Item 2 is selected and clears the overflow as soon as it opens.

Image

Expected Behavior

When setting or clearing the value of the combobox it should accurately display the overflow, if any.

Reproduction Sample

https://codepen.io/mjperez-usgs/pen/NPRBXKp

Reproduction Steps

  1. Select enough options in the combobox to force it to cause the + chip to appear.
  2. Press the 'Set value' button.
  3. Observe that it now says 'Item 2' which is what the value set does. However, note it also still has the overflow chip in the combobox.
  4. Open the combobox, noting that there are no other items selected, and chips have changed. When the combobox closes, the overflow chip is no longer there.

Reproduction Version

5.0

Relevant Info

Windows 11, Chrome 146
Also happens on Edge.

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

Showing that extra values are chosen when they aren't is really confusing to the user and will likely make them very frustrated.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports for broken functionality. Issues should include a reproduction of the bug.c-comboboxIssues that pertain to the calcite-combobox and related componentscalcite-componentsIssues specific to the @esri/calcite-components package.impact - p2 - want for an upcoming milestoneUser set priority impact status of p2 - want for an upcoming milestoneneeds triagePlanning workflow - pending design/dev review.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions