[WC-3347]: fix(combobox-web): keep filter text cleared after select-all + Backspace - #2386
[WC-3347]: fix(combobox-web): keep filter text cleared after select-all + Backspace#2386samuelreichert wants to merge 4 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
9e0e5af to
f1e2229
Compare
This comment has been minimized.
This comment has been minimized.
…-all openspec change
…-all keyboard fix
f1e2229 to
95cb2ae
Compare
AI Code Review
What was reviewed
Skipped (out of scope): CI checks: could not run Findings
|
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Reported by a customer: in a multi-select Combobox, type filter text, press Ctrl/Cmd+A, press Backspace. The input looks empty — but click outside the Combobox and back in, and the text is there again. Using Delete instead of Backspace works correctly.
Root cause.
MultiSelection.tsxlayers a customonKeyDownon top of downshift's input props, gated oninputRef.current?.selectionStart === 0:Fix. downshift already ships exactly the predicate this handler needs, and applies it to its own dropdown Backspace handling — but does not export it. Mirror it locally as
isChipNavigationPermitted: no modifier held, and either an empty input or a caret collapsed at position 0. The ArrowLeft branch carried the identical faulty check and is corrected with it. The helper carries a comment naming the downshift version and source file so a future upgrade re-checks it.What should be covered while testing?
Multi-select Combobox with at least one already-selected chip (with zero chips
setActiveIndex(-1)is a no-op and the bug never surfaces):selectedItemsStyle="boxes": ArrowLeft with a collapsed caret at position 0 reaches the chips; ArrowLeft with text selected stays in the input.