This commit is contained in:
Timothy J. Baek committed 2024-09-18 00:18:47 +02:00
1 parent 5065291f72
commit 984e0c533e
3 files changed
+14 -8

No files matched your search

+10 -7
View File
@@ -44,19 +44,22 @@
window.addEventListener('keydown', handleKeyDown);
document.body.style.overflow = 'hidden';
} else if (modalElement) {
window.removeEventListener('keydown', handleKeyDown);
document.body.removeChild(modalElement);
document.body.style.overflow = 'unset';
}
$: if (!show) {
dispatch('close');
window.removeEventListener('keydown', handleKeyDown);
if (document.body.contains(modalElement)) {
document.body.removeChild(modalElement);
document.body.style.overflow = 'unset';
}
}
onDestroy(() => {
show = false;
if (modalElement) {
document.body.removeChild(modalElement);
if (document.body.contains(modalElement)) {
document.body.removeChild(modalElement);
document.body.style.overflow = 'unset';
}
}
});
</script>