Repository navigation
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
keepFilterText prop for repeated selections
michaldudak
left a comment
There was a problem hiding this comment.
PR review
No blocking findings. I found one close-animation regression in the multiple + input-inside-popup path, and the focused pnpm test:jsdom ComboboxRoot --no-watch suite passes.
Bugs (1)
1. 🟡 Preserve the filtered popup while closing
Location: packages/react/src/combobox/root/AriaCombobox.tsx:585
if (pendingInputBehaviorRef.current.closeAction !== 'skip') {
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));
}For multiple comboboxes with the input inside the popup, this now clears the query immediately on close. The previous code explicitly deferred that clear until unmount for this placement, so the filtered list would not flash back to the unfiltered list during an exit animation.
Failure scenario: In a multiple combobox with Combobox.Input inside Combobox.Popup, type ap, press Escape or click outside, and the closing popup can visibly reset from filtered results to all items before the exit transition finishes.
Fix: Restore the inside-popup guard here, for example only clear immediately when !inputInsidePopup || inline, and let handleUnmount clear the popup input for the animated inside-popup case.
Tests (1)
1. 🟡 Restore default inside-popup multiple selection coverage
Location: packages/react/src/combobox/root/ComboboxRoot.test.tsx:2544
describe('prop: keepFilterText', () => {The old default behavior test for multiple mode with the input inside the popup was replaced by keepFilterText coverage. That leaves the default path unpinned: selecting while filtering inside the popup should keep the popup open but clear the input.
Failure scenario: A future change could make the default inside-popup multiple workflow preserve text, close, or fail to clear, and this suite would still pass.
Fix: Add back a test without keepFilterText for input-inside-popup multiple mode, asserting the popup remains open and the input clears after selecting a filtered item.
Simplifications (0)
No findings.
Docs (0)
No findings.
Verdict
Approve after nits — the issues are non-blocking but worth fixing before merge.
2fcaa4e to
0a6cc86
Compare
Bundle size
PerformanceTotal duration: 1,116.59 ms -23.72 ms(-2.1%) | Renders: 78 (+0) | Paint: 1,775.92 ms -27.51 ms(-1.5%) No significant changes — details Check out the code infra dashboard for more information about this PR. |
|
Closed by #5362 |
Closes #3977
Closes #4348
This adds
keepFilterTexttoCombobox.Rootfor multiple-selection workflows that keep using the same filter after each pick. When the user selects an item while filtering, the current query stays in the input and the list stays open so more matching items can be selected.A use case is GitHub's Labels combobox:
Changes
keepFilterTextfor repeated filtered selection in multiple mode.Bundle size
A fresh same-worktree comparison against
bf2e52725measured@base-ui/reactat 0 B parsed / +16 B gzip. The implementation folds the new behavior into the existing filter check without adding parsed runtime size.