Skip to content

[Bug] -webkit-app-region: drag not working with transparent overlay #435

@juniordeer

Description

@juniordeer

[Bug] -webkit-app-region: drag not working with transparent overlay

Bug Description

The -webkit-app-region: drag CSS property is not working properly when using a transparent overlay for window dragging in frameless windows on macOS.

Steps to Reproduce

  1. Create a frameless window with titleBarStyle: 'hidden' and decorations: false
  2. Add an element with -webkit-app-region: drag and position: fixed covering the entire viewport
  3. Set the overlay to be transparent (background: rgba(255, 255, 255, 0))
  4. Try to drag the window by clicking on the overlay

Expected Behavior

The window should be draggable when clicking anywhere on the transparent overlay.

Actual Behavior

The window is not draggable when clicking on the transparent overlay, regardless of the -webkit-app-region: drag setting.

Environment

  • ElectroBun version: 1.18.1
  • macOS version: 26.4.1
  • Window configuration:
    titleBarStyle: 'hidden',
    frame: {
      decorations: false,
      resizable: true,
    }
  • CSS failing:
    .drag-overlay {
      position: fixed;
      width: 100vw;
      height: 100vh;
      z-index: 10;
      -webkit-app-region: drag;
      pointer-events: all;
      background: rgba(255, 255, 255, 0);
    }

Additional Context

The issue occurs specifically when:

  • Using a transparent overlay for window dragging
  • The overlay covers other elements (like images)
  • The window is frameless/titled
  • Testing on macOS with native WebKit

The -webkit-app-region: drag works on opaque elements but fails when the element is fully transparent, which suggests a potential issue with transparency handling in the drag region detection.

Workarounds Tried

  1. Using semi-transparent background (rgba(255, 255, 255, 0.01)) - still doesn't work
  2. Adding red button with drag region - button shows but doesn't drag window
  3. Setting drag on container itself - interferes with other interactions

Possible Solutions

  1. Fix transparency handling for drag regions
  2. Ensure drag events propagate correctly from transparent overlays
  3. Alternative window dragging API for complex overlay scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions