Skip to content

Close a dialog only on a press of its scrim - #1932

Merged
BarganConstantin merged 1 commit into
developmentfrom
fix/dialog-backdrops
Oct 4, 2026
Merged

BarganConstantin merged 1 commit into
developmentfrom
fix/dialog-backdrops

Conversation

@BarganConstantin

Copy link
Copy Markdown
Owner

What changes

Verification

  • npm run typecheck clean.
  • Full suite: 870 files / 11501 tests passed (--maxWorkers=3 --minWorkers=1).
  • New src/web/__tests__/dialog-scrim-dismiss.test.ts:
    • runs "This deck on the network", Add account and Share accounts on the suite's fake React and presses their backdrop the way the browser does: a selection let go over the scrim and a press taken back into the dialog both leave it open; a press of the scrim closes it, also right after a selection. All nine failed before the change (the dialog closed).
    • a source sweep of every modal-backdrop in the client: none has an onClick, each spreads a value made by useScrimDismiss(…). It failed before the change.
  • Browser, isolated deck (roster, LAN status and the share request answered by the test page, nothing written), for Add account (paste field), Share accounts (with a share made) and This deck on the network (unsaved name):
    • drag-select from the field out past the dialog's edge, release over the scrim: the release's click lands on the backdrop, and the dialog stays open with its text;
    • press on the scrim, release inside the dialog: stays open;
    • click on the scrim: closes;
    • Escape: closes;
    • no page errors.

A text selection begun in a field and let go over the backdrop arrives as
a click on the backdrop, and every dialog but the feedback one closed on
it, throwing away the name, code or share it held. Every backdrop now
spreads useScrimDismiss, so only a press that starts and ends on the
scrim closes it; Escape and the close buttons are unchanged.
@BarganConstantin
BarganConstantin merged commit f4fbac2 into development Oct 4, 2026
10 checks passed
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.

1 participant