LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-vega
createdAtNov 19, 2026, 4:42 AM
updatedAtNov 19, 2026, 10:59 AM
githubUrlhttps://github.com/neomjs/neo/issues/21431
authorneo-opus-vega
commentsCount0
parentIssue21367
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 19, 2026, 10:59 AM

A modal dialog destroyed without close() takes its mask along

neo-opus-vega
neo-opus-vega commented on Nov 19, 2026, 4:42 AM

Owned: a leaf of #21367 (Dialogs group) until its lock, Sun 22 Nov 18:00 CET.

Context

Maryam's approval of PR #21417 named the path: component.Base#destroy() bypasses close() and unmount(), so a modal dialog its owner destroys directly never releases its mask. Reproduced in examples/dialog on dev after #21417, with Modal checked:

Create Dialog              -> #neo-dialog-1 (neo-modal), .neo-dialog-modal-mask visible
destroyNeoInstance('neo-dialog-1')
after 1.5 s                -> #neo-dialog-1 gone, .neo-dialog-modal-mask display:block,
                              elementFromPoint(page centre) = .neo-dialog-modal-mask

The page stays blocked behind a mask with no dialog over it.

The Problem

dialog.Base#close() releases the mask itself, syncModalMask(me.id, false) before destroy(true) (src/dialog/Base.mjs:529-532). Every other way out skips it. An owner that destroys its modal dialog, or a container destroying its items, leaves the mask over the page.

The Architectural Reality

Design authority: src/dialog/Base.mjs:529, "The mask leaves with the dialog". #21415 made that true for close() only.

  • Neo.main.DomAccess#syncModalMask({id, modal: false}) places the mask under the topmost remaining modal and leaves the departing id out (#21417), so it is safe to call while the node is still on the page.
  • component.Base#destroy (src/component/Base.mjs:1437) is the one exit every teardown takes; close() reaches it too.

The Fix

  • src/dialog/Base.mjs: a destroy() override releases the mask of a mounted modal dialog, then calls super.destroy(). close() drops its own syncModalMask(me.id, false), which destroy(true) now runs.
  • A unit or component spec: a mounted modal dialog destroyed directly leaves no mask over the page.

Decision Record impact

none

Acceptance Criteria

  • AC-1: A mounted modal dialog destroyed without close() releases the modal mask: no mask stays over the page, and a modal dialog beneath it keeps its mask.
  • AC-2: close() keeps releasing the mask before the dialog leaves, through the same path.

Out of Scope

  • Focus hand-back on a direct destroy: component.Base#destroy already runs revertFocusOnDeparture().
  • closeAction: 'hide' consumers (desktop.WindowManager, board.CardEditor, timeline.EventEditor): hide already syncs the mask.

Avoided Traps

  • A release in each owner that destroys a dialog. Every new owner would need to know it; the dialog owns its mask.

Related

Live latest-open + closed sweep: checked latest 20 open + open and closed search (modal mask dialog; modal mask dialog destroy) at 2026-11-19T03:41:36Z; closed #21415 is the predecessor, open #21066 is a different defect; no equivalent found. Backlog band: 77 open (red); folds under its owning epic #21367. A2A claim sweep: last 12 messages, no claim on dialog masks. MC sweep: "modal mask stays over the page after the dialog is destroyed, syncModalMask not called", 5 results; #20448 and #21415 are the prior mask work, no decision against this. Own-assignment sweep: 10 open, none overlapping.

Retrieval Hint: "modal dialog destroyed directly leaves its mask over the page"