SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

0 0 16 TypeScript

fix(ui): clicking filtered Combobox entries fails to trigger selection (#15788)

### What?
When using the Combobox with search filtering (e.g. CodeBlock language
selector), clicking a filtered entry closes the popup but doesn't
trigger `onSelect`. Without filtering, selection works correctly.

<img width="278" height="248" alt="image"
src="https://github.com/user-attachments/assets/7c2747b9-969a-4c46-acec-e4a2140ed734"
/>

### Why?
The Popup's `handleActionableClick` listener detects the
`[role="menuitem"]` click and closes the popup, which calls
`setSearchValue('')` via `onToggleClose`.
This rebuilds the entry list, removing the clicked DOM node before
React's synthetic `onClick` can fire.

### How?
The fix adds `data-popup-prevent-close` to Combobox entry divs.
Popup already checks for this attribute in `handleActionableClick`
(Popup/index.tsx L323-324) and skips auto-closing, letting the
Combobox's own `handleClick` handle both selection and closing.

One-line change in `packages/ui/src/elements/Combobox/index.tsx`.

---------

Co-authored-by: Patrik Kozak <35232443+PatrikKozak@users.noreply.github.com>
S
Seiya committed
de3e5ae4d86cfc9c79ed14efc78f916452491ff1
Parent: b95df0b
Committed by GitHub <noreply@github.com> on 3/11/2026, 12:18:55 AM