fix(responsive-dropdown): keep dropdown open when window loses focus#136
Merged
Merged
Conversation
@radix-ui/react-menu >=2.1.17 registers a window blur listener that closes any open menu. Opening the native file picker (or switching apps to drag a file in) blurs the window, so DropdownMenu-based ResponsiveDropdown content unmounted before the file selection ever landed — silently breaking the DNS record import dropzone in cloud-portal. Swap the desktop variant to a Radix Popover: same anchored dropdown UX and modality, no blur-close behavior, and dialog semantics fit the arbitrary interactive children this component hosts (none of its consumers render DropdownMenuItem). Adds a regression test asserting the dropdown stays open on window blur.
AriaEdo
approved these changes
Jul 2, 2026
3 tasks
mattdjenkinson
added a commit
to datum-cloud/cloud-portal
that referenced
this pull request
Jul 6, 2026
…ose (#1329) ## Problem Importing a BIND zone file on the DNS records page did nothing — no preview dialog, no error, no processing. Root cause: `@radix-ui/react-menu` ≥2.1.17 (pulled in by #1321) closes any open menu on **window blur**. The import dropzone lives inside `ResponsiveDropdown` (a Radix DropdownMenu on desktop), so clicking **Select a file** (native picker) or dragging a file in from Finder blurred the window, closed the dropdown, and unmounted the dropzone before `onDrop` fired. ## Fix - **Bump `@datum-cloud/datum-ui` to ^1.3.2** — `ResponsiveDropdown` renders a Radix Popover on desktop (same UX, no blur-close). Upstream: datum-cloud/datum-ui#136. - `handleDrop` reports whether the preview opened; the dropdown only closes on success so parse errors stay visible. - Empty accepted-file drops show an error instead of failing silently. ## Test plan - [ ] Import via file picker — dropdown stays open while the picker is up, preview dialog opens with parsed records - [ ] Import via drag-and-drop from Finder - [ ] Invalid file → error shown inside the dropdown; Export still works ## Note The E2E regression checks are red due to a **separate, pre-existing** control-plane change (org creation now requires a system-assigned `generateName`; `createStandardOrg` fails with 422). It's unrelated to this PR and affects `main` too — tracked/fixed separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@radix-ui/react-menu≥2.1.17 registers awindowblurlistener that closes any open menu. Opening the native file picker (or switching apps to drag a file in) blurs the window, so DropdownMenu-basedResponsiveDropdowncontent unmounted before the file selection ever landed — silently breaking the DNS record import dropzone in cloud-portal (no dialog, no error, no processing).Fix
Swap the desktop variant of
ResponsiveDropdownfrom Radix DropdownMenu to Radix Popover:modalbehavior;contentClassName/onCloseAutoFocuspass through unchanged.@radix-ui/react-popover1.1.15).MoreActions, DataTablerow-actions,task-queue-dropdown, cloud-portal notification dropdown + DNS import) renders plain buttons/divs — none useDropdownMenuItem, so nothing depended on menu semantics.PopoverContentgets menu-parity sizing (w-auto min-w-[8rem] p-0, available-height max) so existing layouts are unaffected.Tests
bluronwindowwhile open must NOT callonOpenChange(false). Red against the old DropdownMenu implementation (with react-menu 2.1.18), green with Popover.