Skip to content

@remotion/studio: Fix enum dropdown outside-clicks#7902

Closed
jroxas44 wants to merge 1 commit into
remotion-dev:mainfrom
jroxas44:fix/7763-enum-dropdown-close
Closed

@remotion/studio: Fix enum dropdown outside-clicks#7902
jroxas44 wants to merge 1 commit into
remotion-dev:mainfrom
jroxas44:fix/7763-enum-dropdown-close

Conversation

@jroxas44
Copy link
Copy Markdown

@jroxas44 jroxas44 commented Jun 1, 2026

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

  • Added onPointerDown={onHide} to the fullScreenOverlay in ComboBox.tsx, so backdrop clicks immediately close the dropdown.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Jun 1, 2026

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

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Jun 1, 2026 5:40am
remotion Ready Ready Preview, Comment Jun 1, 2026 5:40am

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — adds onPointerDown={onHide} to the fullScreenOverlay backdrop so clicks outside the enum dropdown close it.
  • ContextMenu.tsx — adds onPointerDown={onHide} and an onContextMenu handler to the backdrop that hides the open menu and re-dispatches a synthetic contextmenu event to the element under the cursor.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2𝕏

{portalStyle
? ReactDOM.createPortal(
<div style={fullScreenOverlay}>
<div style={fullScreenOverlay} onPointerDown={onHide}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()}>
```

@JonnyBurger JonnyBurger changed the title @remotion/studio: fix enum dropdown outside-clicks and right-click co… @remotion/studio: Fix enum dropdown outside-clicks Jun 1, 2026
Co-authored-by: Your Name <jmroxas96@gmail.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JonnyBurger JonnyBurger force-pushed the fix/7763-enum-dropdown-close branch from 10a1e75 to f2a27cc Compare June 1, 2026 07:43
@JonnyBurger
Copy link
Copy Markdown
Member

Tested and does not work correctly - now the item you click does not get selected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clicking outside an enum control does not close dropdown

2 participants