Skip to main content
cngx-src documentation

withDismissOnBlur

Functioncommon/interactive/menu

projects/common/interactive/menu/menu-config-features.ts

Description#

Whether the "context lost" bundle dismisses the menu. The bundle covers BOTH window blur (system notification, OS-native menu overlaying, tab switch) AND document pointercancel outside the popover and trigger host (palm rejection on touch, gesture cancelled by the browser). The two sources share one toggle because consumers who want one rarely want the other off; consumers needing one without the other replace the entire handler via CNGX_MENU_DISMISS_HANDLER_FACTORY. Set to false to keep both listeners off; lastDismissSource will then never report 'blur' or 'pointer-cancel'.

Default: true.

Signature#

withDismissOnBlur(dismiss: boolean)

Parameters#

@paramdismissboolean

Returns#

CngxMenuConfigFeature