Skip to content

Commit c60f4e9

Browse files
committed
fix(modal): move isOpen check inside AnimatePresence for exit animations
- Remove early return 'if (!isOpen) return null' which prevented exit animations - Always render AnimatePresence wrapper - Gate modal content with {isOpen && (...)} inside AnimatePresence - Now modal properly animates out when closing
1 parent 5c65021 commit c60f4e9

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

frontend/src/components/IndexingProgressModal.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,16 @@ export function IndexingProgressModal({
8181
onRetry?.()
8282
}
8383

84-
if (!isOpen) return null
85-
8684
return (
8785
<AnimatePresence>
88-
<motion.div
89-
initial={{ opacity: 0 }}
90-
animate={{ opacity: 1 }}
91-
exit={{ opacity: 0 }}
92-
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"
93-
onClick={handleClose}
94-
>
86+
{isOpen && (
87+
<motion.div
88+
initial={{ opacity: 0 }}
89+
animate={{ opacity: 1 }}
90+
exit={{ opacity: 0 }}
91+
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"
92+
onClick={handleClose}
93+
>
9594
<motion.div
9695
initial={{ scale: 0.95, opacity: 0 }}
9796
animate={{ scale: 1, opacity: 1 }}
@@ -190,7 +189,8 @@ export function IndexingProgressModal({
190189
)}
191190
</div>
192191
</motion.div>
193-
</motion.div>
192+
</motion.div>
193+
)}
194194
</AnimatePresence>
195195
)
196196
}

0 commit comments

Comments
 (0)