1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +12:00

Handle nullish values being passed into clickoutside util

This commit is contained in:
Andrew Kingston 2022-11-22 16:43:34 +00:00
parent be3a004310
commit 91b9396212

View file

@ -1,7 +1,7 @@
export default function clickOutside(element, callbackFunction) {
function onClick(event) {
if (!element.contains(event.target)) {
callbackFunction(event)
callbackFunction?.(event)
}
}