@remotion/studio: Fix enum dropdown outside-clicks#7902
Conversation
There was a problem hiding this comment.
Caution
The ComboBox fix introduces a regression: clicking any item inside the dropdown now closes it immediately because the pointerdown event bubbles from the menu content up to the overlay.
Reviewed changes — fixes for two Studio overlay interaction bugs: enum dropdown outside-click dismissal and context-menu right-click forwarding.
ComboBox.tsx— addsonPointerDown={onHide}to thefullScreenOverlaybackdrop so clicks outside the enum dropdown close it.ContextMenu.tsx— addsonPointerDown={onHide}and anonContextMenuhandler to the backdrop that hides the open menu and re-dispatches a syntheticcontextmenuevent to the element under the cursor.
Kimi K2 | 𝕏
| {portalStyle | ||
| ? ReactDOM.createPortal( | ||
| <div style={fullScreenOverlay}> | ||
| <div style={fullScreenOverlay} onPointerDown={onHide}> |
There was a problem hiding this comment.
The onPointerDown={onHide} on the overlay will also catch bubbled pointerdown events from the dropdown menu content (the portalStyle div and MenuContent inside it), causing the dropdown to close immediately when the user tries to click any item.
ContextMenu.tsx avoids this by calling e.stopPropagation() in onMenuPointerDown on the inner portalStyle div. ComboBox.tsx needs the same protection.
Technical details
# Missing stopPropagation on ComboBox menu content
## Affected sites
- `packages/studio/src/components/NewComposition/ComboBox.tsx:270` — `onPointerDown={onHide}` on `fullScreenOverlay`
- `packages/studio/src/components/NewComposition/ComboBox.tsx:273` — inner `portalStyle` div lacks `onPointerDown` handler
## Required outcome
- Clicking the dropdown backdrop closes the dropdown.
- Clicking inside the dropdown menu content does **not** close the dropdown.
## Suggested approach
Add `onPointerDown={(e) => e.stopPropagation()}` to the inner `<div style={portalStyle}>` in `ComboBox.tsx`, mirroring the pattern used in `ContextMenu.tsx` (`onMenuPointerDown`).
```tsx
<div style={portalStyle} onPointerDown={(e) => e.stopPropagation()}>
```@remotion/studio: Fix enum dropdown outside-clicks
Co-authored-by: Your Name <jmroxas96@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
10a1e75 to
f2a27cc
Compare
|
Tested and does not work correctly - now the item you click does not get selected. |

Description
Fixes #7763.
Clicking outside the enum dropdown in Studio did not always dismiss it because the fullscreen overlay intercepted pointer events but had no direct dismiss handler.
What changed
onPointerDown={onHide}to thefullScreenOverlayinComboBox.tsx, so backdrop clicks immediately close the dropdown.