Function addClickOutsideListener

Add event listener to listen to clicks outside of given element

  • Parameters

    • element: HTMLElement

      Node element outside which to listen to clicks

    • fn: () => any

      Function to trigger when clicked outside

    Returns void

    void