Skip to content

fix(PowerSearch): prevent edit popover from closing when selecting multi-select options via Enter#4246

Open
saadpocalypse wants to merge 1 commit into
facebook:mainfrom
saadpocalypse:fix/powersearch-multiselect-enter
Open

fix(PowerSearch): prevent edit popover from closing when selecting multi-select options via Enter#4246
saadpocalypse wants to merge 1 commit into
facebook:mainfrom
saadpocalypse:fix/powersearch-multiselect-enter

Conversation

@saadpocalypse

Copy link
Copy Markdown

Fixes #4245

Summary

In PowerSearchEditPopover, container-level keydown handling for Enter previously did not check !e.defaultPrevented. When editing a multi-select filter (such as enum_list, Tokenizer, or BaseTypeahead), pressing Enter to confirm a highlighted option calls e.preventDefault(). Because PowerSearchEditPopover ignored defaultPrevented, the event bubbled up and triggered handleSave(), closing the popover prematurely instead of selecting the option.

This change guards the Enter branch in PowerSearchEditPopover.tsx with !e.defaultPrevented so option selection in child listboxes is respected, while plain input submissions and closed listboxes continue to save on Enter.

Changes

  • packages/core/src/PowerSearch/PowerSearchEditPopover.tsx: Guard Enter keydown handler with !e.defaultPrevented.
  • packages/core/src/PowerSearch/PowerSearchEditPopover.test.tsx: Added unit test covering Enter key behavior with consumed child listbox events.
  • .changeset/fix-powersearch-multiselect-enter.md: Added pre-1.0 patch changeset for @astryxdesign/core.

Verification

  • Unit Tests: Added test in PowerSearchEditPopover.test.tsx. All 145 PowerSearch tests and 7,415 workspace tests passed.
  • Linting: Ran pnpm lint (check:repo, check:sync, check:package-boundaries, check:changesets, check:demo-media, check:executable-bits) with 0 errors.
  • Build: Core package built successfully via pnpm -F @astryxdesign/core build.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 23, 2026 6:53am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 23, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge labels Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] PowerSearch: Enter in a multi-select filter closes the popover instead of selecting the value (when one item is already selected)

1 participant