Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/studio/src/components/NewComposition/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export const Combobox: React.FC<{
</button>
{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()}>
```

<div style={outerPortal} className="css-reset">
<HigherZIndex onOutsideClick={onHide} onEscape={onHide}>
<div style={portalStyle}>
Expand Down
Loading