Fix closing popups when clicking outside of them (#378)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/378 Co-authored-by: konrad <konrad@kola-entertainments.de> Co-committed-by: konrad <konrad@kola-entertainments.de>
This commit is contained in:
@ -11,7 +11,7 @@ export const closeWhenClickedOutside = (event, rootElement, closeCallback) => {
|
||||
// closing callback when a click happens outside of the rootElement.
|
||||
let parent = event.target.parentElement
|
||||
while (parent !== rootElement) {
|
||||
if (parent.parentElement === null) {
|
||||
if (parent === null || parent.parentElement === null) {
|
||||
parent = null
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user