fix(PowerSearch): prevent edit popover from closing when selecting multi-select options via Enter#4246
Open
saadpocalypse wants to merge 1 commit into
Open
Conversation
…lti-select options via Enter (facebook#4245)
saadpocalypse
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 23, 2026 06:50
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4245
Summary
In
PowerSearchEditPopover, container-level keydown handling forEnterpreviously did not check!e.defaultPrevented. When editing a multi-select filter (such asenum_list,Tokenizer, orBaseTypeahead), pressingEnterto confirm a highlighted option callse.preventDefault(). BecausePowerSearchEditPopoverignoreddefaultPrevented, the event bubbled up and triggeredhandleSave(), closing the popover prematurely instead of selecting the option.This change guards the
Enterbranch inPowerSearchEditPopover.tsxwith!e.defaultPreventedso option selection in child listboxes is respected, while plain input submissions and closed listboxes continue to save onEnter.Changes
packages/core/src/PowerSearch/PowerSearchEditPopover.tsx: GuardEnterkeydown handler with!e.defaultPrevented.packages/core/src/PowerSearch/PowerSearchEditPopover.test.tsx: Added unit test coveringEnterkey behavior with consumed child listbox events..changeset/fix-powersearch-multiselect-enter.md: Added pre-1.0 patch changeset for@astryxdesign/core.Verification
PowerSearchEditPopover.test.tsx. All 145 PowerSearch tests and 7,415 workspace tests passed.pnpm lint(check:repo,check:sync,check:package-boundaries,check:changesets,check:demo-media,check:executable-bits) with 0 errors.pnpm -F @astryxdesign/core build.