clickaway
Clickaway is a user interface interaction pattern in which an open element such as a dropdown, tooltip, modal, popover, or context menu is dismissed when the user clicks anywhere outside of that element. The pattern is used to provide a quick, unobtrusive way to close transient UI elements after a selection or to cancel an action without requiring explicit confirmation.
Implementation typically involves detecting clicks at a higher level in the document and determining whether the
Accessibility considerations are important. Clickaway should be complemented by keyboard dismissal (such as the Escape key)
Common variations and considerations include touch behavior on mobile devices, overlay interaction, and layering with other