API Reference > ui-core > Utilities > useOnOutsideClick useOnOutsideClick Function Invokes onOutsideClick handler when user clicks outside of referenced element. useOnOutsideClick<T extends Element>(onOutsideClick?: () => void, outsideEventPredicate?: (e: OutsideClickEvent) => boolean): RefObject<T> Parameter Type Description onOutsideClick () => void outsideEventPredicate (e: OutsideClickEvent) => boolean Returns - RefObject<T> Defined in ui/core/src/ui-core/utils/hooks/useOnOutsideClick.tsx Line 19 Last Updated: 12 June, 2024