Skip to content

Commit 4e58369

Browse files
committed
fix: fix closing modal bug
1 parent ef83913 commit 4e58369

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

frontend/src/GitHubSettingsTab.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,12 @@ function Modal({
123123
}) {
124124
if (!open) return null;
125125
return (
126-
<>
127-
<div
128-
className="fixed inset-0 z-50 bg-black/50"
129-
aria-hidden="true"
130-
onClick={onClose}
131-
/>
132-
<div className="fixed inset-0 z-50 flex items-start justify-center pt-[7.5vh] p-4 overflow-y-auto">
133-
{children}
134-
</div>
135-
</>
126+
<div
127+
className="fixed inset-0 z-50 bg-black/50 flex items-start justify-center pt-[7.5vh] p-4 overflow-y-auto"
128+
onClick={onClose}
129+
>
130+
{children}
131+
</div>
136132
);
137133
}
138134

@@ -147,6 +143,7 @@ function ModalContent({
147143
<div
148144
role="dialog"
149145
aria-modal="true"
146+
onClick={(e) => e.stopPropagation()}
150147
className={cn(
151148
"relative z-10 mx-auto flex flex-col max-h-[85vh] lg:h-[85vh] overflow-hidden rounded-lg border border-border bg-background shadow-xl w-full",
152149
className,

0 commit comments

Comments
 (0)