Skip to content

[Bug]: Settings or Usage closes when a press on the backdrop is released inside the window #45028

Done

Description

@MauriceCRRR

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open Settings (or Usage).
  2. Press the mouse button on the dimmed area outside the window and keep it pressed.
  3. Move the pointer onto the window, for example over a text field, and release.

Expected behavior

The window stays open. A press that ends inside the window is not a dismissal, in the same way the existing guard already ignores a text selection that starts inside and ends on the backdrop.

Actual behavior

The window closes, and anything in it that was not applied yet is lost.

The handler on the dialog's viewport in apps/web/src/components/AppRouteModal.tsx (lines 115 to 121) records on pointerdown whether the press started on the viewport, and closes on a click whose target is the viewport. When a press and its release land on different elements, the browser dispatches click on their nearest common ancestor. The popup is a child of the viewport, so for a press on the backdrop released inside the popup that ancestor is the viewport itself and both checks pass.

A possible fix: also require the release to be over the backdrop (judged by position on pointerup, since touch keeps the pointer captured on the element where the press started), and clear the flag on pointercancel.

Impact

Minor bug or occasional failure

Version or commit

main @ ed54785 (the handler is the same in v0.1.13)

Environment

macOS 27.2, Chromium 156.0.8078.4

Logs or stack traces

Reproduced at 5b2b766 in the repository's browser test runner (Playwright 1.64.1, headless Chromium, trusted mouse input) with the unmodified component: press at a point on the backdrop, move, release over a text input inside the dialog. Events recorded: pointerdown on the viewport, pointerup on the input, click on the viewport; the dialog closes. Controls behave as intended: press and release on the backdrop closes it; press inside and release on the backdrop leaves it open.

Not tried by hand in a release build.

Workaround

None needed beyond not dragging from the backdrop into the window.


Found and written up with Claude Fable 5.2 in Claude Code.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions