Skip to content

Commit 7a2c1aa

Browse files
committed
fix: prevent modal backdrop clicks from propagating to parent elements
1 parent 6c56610 commit 7a2c1aa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "use-vibes",
3-
"version": "0.4.13",
3+
"version": "0.4.14",
44
"type": "module",
55
"description": "Transform any DOM element into an AI-powered micro-app",
66
"main": "dist/index.js",

src/components/ImgGenUtils/ImgGenModal.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ export function ImgGenModal({
8080
const effectivePromptText = promptText;
8181

8282
return createPortal(
83-
<div className="imggen-backdrop" onClick={onClose} role="presentation">
83+
<div
84+
className="imggen-backdrop"
85+
onClick={(e) => {
86+
e.stopPropagation(); // Prevent click from propagating beyond
87+
onClose();
88+
}}
89+
role="presentation">
8490
<figure className="imggen-full-wrapper" onClick={(e) => e.stopPropagation()}>
8591
{error ? (
8692
<div className="imggen-backdrop-error">

0 commit comments

Comments
 (0)