refac: styling

This commit is contained in:
Timothy J. Baek
2024-06-18 15:39:50 -07:00
parent d5a1030000
commit 35026849df
3 changed files with 13 additions and 13 deletions

View File

@@ -33,14 +33,14 @@
mounted = true;
});
$: if (mounted) {
if (show) {
window.addEventListener('keydown', handleKeyDown);
document.body.style.overflow = 'hidden';
} else {
window.removeEventListener('keydown', handleKeyDown);
document.body.style.overflow = 'unset';
}
$: if (show && modalElement) {
document.body.appendChild(modalElement);
window.addEventListener('keydown', handleKeyDown);
document.body.style.overflow = 'hidden';
} else if (modalElement) {
document.body.removeChild(modalElement);
window.removeEventListener('keydown', handleKeyDown);
document.body.style.overflow = 'unset';
}
</script>