You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Support missing refs (fixes#531)
* Add support for focus event to `useOnClickOutside` (Fixes: #522)
* Expose `AddEventListenerOptions` in `useOnClickOutside` (Fixes#554 from @metav-drimz)
* Custom hook that handles clicks outside a specified element.
10
16
* @template T - The type of the element's reference.
11
17
* @param {RefObject<T> | RefObject<T>[]} ref - The React ref object(s) representing the element(s) to watch for outside clicks.
12
-
* @param {(event: MouseEvent | TouchEvent) => void} handler - The callback function to be executed when a click outside the element occurs.
18
+
* @param {(event: MouseEvent | TouchEvent | FocusEvent) => void} handler - The callback function to be executed when a click outside the element occurs.
13
19
* @param {EventType} [eventType] - The mouse event type to listen for (optional, default is 'mousedown').
20
+
* @param {?AddEventListenerOptions} [eventListenerOptions] - The options object to be passed to the `addEventListener` method (optional).
0 commit comments