Skip to content

Dialog's document-level Escape listener ignores nested dismissable layers (protoAgent#2466) #4

Description

@mabry1985

useOverlayDismiss (overlays.tsx) binds a document-level keydown that closes the Dialog on Escape unconditionally. A nested radix layer (DropdownSelect menu, popover) handles the same Escape to dismiss itself — one keypress closes BOTH, losing the user's dialog context.

Downstream report: protoLabsAI/protoAgent#2466 (Settings ▸ Model picker, found in the Windows v0.130.0 acceptance pass). protoAgent is shipping a consumer-side workaround (skip the close while [data-radix-popper-content-wrapper] :is([role=menu],[role=listbox],[role=dialog]) is in the DOM — the layer that consumed the press is still mounted during the event dispatch; tooltips excluded). The arbitration belongs in the DS so every Dialog consumer gets it: either the same topmost-layer check inside useOverlayDismiss, or DS-owned layers marking the event consumed and the Dialog respecting defaultPrevented. protoAgent will revert its workaround once released.

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