comment fixing

This commit is contained in:
Michael Freno
2026-01-06 13:40:32 -05:00
parent 1f661f4f89
commit 133800f2e3
7 changed files with 296 additions and 64 deletions

View File

@@ -31,20 +31,22 @@ export default function Modal(props: ModalProps) {
};
onMount(() => {
if (props.open) {
if (props.open && typeof document !== "undefined") {
document.addEventListener("keydown", handleEscapeKey);
}
});
onCleanup(() => {
document.removeEventListener("keydown", handleEscapeKey);
if (typeof document !== "undefined") {
document.removeEventListener("keydown", handleEscapeKey);
}
});
return (
<Show when={props.open}>
<Portal>
<div
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
class="fixed inset-0 z-500 flex items-center justify-center bg-black/50"
onClick={handleBackdropClick}
role="dialog"
aria-modal="true"