Handle nullish values being passed into clickoutside util
This commit is contained in:
parent
be3a004310
commit
91b9396212
|
@ -1,7 +1,7 @@
|
||||||
export default function clickOutside(element, callbackFunction) {
|
export default function clickOutside(element, callbackFunction) {
|
||||||
function onClick(event) {
|
function onClick(event) {
|
||||||
if (!element.contains(event.target)) {
|
if (!element.contains(event.target)) {
|
||||||
callbackFunction(event)
|
callbackFunction?.(event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue