Skip to content

fix(ui): keep floating surfaces clickable over desktop drag regions - #67285

Merged
arvsrn merged 1 commit into
devfrom
drag-overlay-fix
Nov 30, 2026
Merged

arvsrn merged 1 commit into
devfrom
drag-overlay-fix

Conversation

@arvsrn

@arvsrn arvsrn commented Nov 30, 2026

Copy link
Copy Markdown
Member

Summary

Electron's drag areas take mouse presses before the page sees them, whatever is drawn on top. Menus and popovers portalled over the session header's drag gap (or the titlebar) look clickable, but a click there starts a window drag. Electron's documented fix is to mark the surfaces on top as no-drag, which cuts a hole in the drag area only while they're open.

 /* packages/ui/src/styles/base.css */
 *[data-tauri-drag-region] [contenteditable] {
   app-region: no-drag;
 }
+
+[data-popper-positioner],
+[data-floating-overlay] {
+  app-region: no-drag;
+}

This covers menus, submenus, selects, popovers and other floating surfaces. No flag: this is a bug fix.

Closes #63776

Evidence

  • Before: in the desktop app on macOS, menu items over the header gap (the tab context menu's "Pin" and "Rename") didn't respond to clicks; the press moved the window.
    After: with the rule in place, those items click, the window still drags from the gap outside the menu, and the gap drags again once the menu closes. Tested by hand with real clicks.
  • e2e/regression/session-header.spec.ts › "the desktop session header drags the window from the gap after the title" (ltr, rtl) now opens a menu and checks:
    open "More options"   -> menu positioner has app-region: no-drag
    close it              -> header gap still has app-region: drag
    
    Passes with the fix. Playwright's synthetic clicks skip the OS drag handling, so this checks the CSS Electron reads.

Merge Danger

Door: two-way

One CSS rule; reverting it restores the old behaviour.

Blast Radius: drag areas

Only the area under a visible popper or floating overlay stops dragging, and only while it's laid out. Web builds ignore app-region. Windows uses the same Chromium mechanism but hasn't been tried by hand.

@opencodejr opencodejr Bot left a comment

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.

I couldn't verify this: the bug only happens in the Electron desktop app on macOS. Headless Chromium can't launch here (missing system libraries), so the e2e spec didn't run either. From reading the code, the approach is right. The positioners and overlays are portalled after the drag regions, so their no-drag cuts a hole only while they're shown. Every place that sets data-floating-overlay sets it only while visible.

Public API: unchanged.

One small concern, inline: tooltip positioners match too. The e2e addition only checks the computed CSS, which synthetic clicks can't really exercise. For a one-rule fix it can be dropped to keep the change minimal.

The OS takes presses inside a drag region before the page sees them, whatever is painted on top. A later no-drag
region cuts a hole in it, so menus and popovers portalled over the titlebar or the session header stay clickable.
*/
[data-popper-positioner],

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.

This also matches tooltip positioners. A tooltip that appears over the titlebar or the header gap, for example while hovering a tab, would stop window dragging under it while it's shown, even though it isn't interactive. packages/app/src/runtime/plugin/embeds.tsx already leaves tooltips out of its overlay check with [data-popper-positioner]:not(:has([role="tooltip"])). Doing the same here would keep the hole to surfaces you can actually click.

@arvsrn
arvsrn merged commit e3d2482 into dev Nov 30, 2026
11 checks passed
@arvsrn
arvsrn deleted the drag-overlay-fix branch November 30, 2026 08:36
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.

desktop: Rename and Export items in session tab context menu are not clickable

1 participant