CngxMenuDismissSource
projects/common/interactive/menu/dismiss-handler.ts
Description#
Identifier for the dismissal path that fired most recently.
outside-click- pointerdown outside both the popover and the trigger host.scroll- window scroll while the menu is open.blur- window blur (system notification, OS-native context menu overlaying the cngx menu).pointer-cancel- document pointercancel originating OUTSIDE the popover and host (palm rejection from outside the menu, gesture cancelled by the browser). In-menu palm rejections do not dismiss.escape- documentkeydownmatching theEscapekey while the popover is visible. Detected by the factory's capture-phase keydown listener so the source is recorded regardless of where DOM focus sits (trigger button, menu container, or elsewhere).Intent, not effect. The factory records
'escape'synchronously on the keystroke and does NOT callpopover.hide(). Whether the menu actually closes is owned byCngxPopover.closeOnEscape: consumers who set[closeOnEscape]="false"keep their menu open even thoughlastSourcereports'escape'. The other sources (outside-click,scroll,blur,pointer-cancel) callpopover.hide()themselves and so always coincide with an actual close -'escape'is the one source where intent and effect can diverge.
Definition#
"outside-click" | "scroll" | "blur" | "pointer-cancel" | "escape"