fix(components): reselecting a removed lineage chip now works#1126
Conversation
After removing a chip from the multi-select lineage filter, downshift's internal selectedItem still held the removed value, so clicking that same item again produced no state change and no event. Resetting selectedItem to null in the stateReducer after each selection clears this stale reference. Adds a regression story MultiSelectReselectAfterRemove that reproduces the original failure sequence. Closes #1125 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude: The real fix (4 lines):
Why 100 lines in the diff:
So if you look at downshift-combobox.tsx alone, it's about 5 changed lines. The rest is the test story. |
There was a problem hiding this comment.
Pull request overview
Fixes a Downshift multi-select edge case in the lineage filter where removing a selected chip could leave Downshift’s internal selectedItem pointing at the removed value, preventing re-selection of that same option. Adds a Storybook interaction story to reproduce and guard against the regression.
Changes:
- Reset Downshift combobox
selectedItemwhen a chip is removed in the multi-select combobox. - Add a regression Storybook play scenario that removes a lineage chip and then re-selects it from the dropdown.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| components/src/preact/components/downshift-combobox.tsx | Clears Downshift selection state after removing a selected chip in the multi-select combobox. |
| components/src/preact/lineageFilter/lineage-filter.stories.tsx | Adds an interaction story covering “remove then reselect” for the multi-select lineage filter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…elect clearAll did not call selectItem(null), leaving downshift's internal selectedItem set to the last-selected item. Trying to pick that same item again after clearing produced no state change and no event. Adds a regression story MultiSelectReselectAfterClearAll. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 I have created a release *beep* *boop* --- ## [1.18.1](dashboard-components-v1.18.0...dashboard-components-v1.18.1) (2026-07-02) ### Bug Fixes * **components:** reselecting a removed lineage chip now works ([#1126](#1126)) ([5ad3a24](5ad3a24)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Closes #1125
Summary
After removing a chip from the multi-select lineage filter, downshift's internal selectedItem still held the removed value, so clicking that same item again produced no state change and no event. Resetting selectedItem to null in the stateReducer after each selection clears this stale reference.
Adds a regression story MultiSelectReselectAfterRemove that reproduces the original failure sequence.
PR Checklist