Hex Core JS
    Preparing search index...

    Function useClickOutListener

    • Listens for clicks outside of the specified element.

      Useful for closing a small pop-up or expanded section when the user clicks outside the open element.

      Parameters

      • elements: ElementType | ElementType[]

        The element(s) to check for clicks outside of. Any null/undefined values are ignored.

      • callback: () => void

        The callback function to call when a click is detected outside of the element.

      • enabled: boolean = true

        Controls whether the callback can be called or not.

      Returns void