Skip to content

Commit be7eeb5

Browse files
fix(ui): fix viewer getting stuck when spamming toggle
1 parent af9f0e0 commit be7eeb5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

invokeai/frontend/web/src/features/gallery/components/ImageViewer/ImageViewer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ export const ImageViewer = memo(() => {
4242
useHotkeys('z', onToggle, { enabled: isViewerEnabled }, [isViewerEnabled, onToggle]);
4343
useHotkeys('esc', onClose, { enabled: isViewerEnabled }, [isViewerEnabled, onClose]);
4444

45+
// The AnimatePresence mode must be wait - else framer can get confused if you spam the toggle button
4546
return (
46-
<AnimatePresence>
47+
<AnimatePresence mode="wait">
4748
{shouldShowViewer && (
4849
<Flex
4950
key="imageViewer"

invokeai/frontend/web/src/features/ui/components/InvokeTabs.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ const InvokeTabs = () => {
254254
/>
255255
</>
256256
)}
257-
<Panel style={{ position: 'relative' }} id="main-panel" order={1} minSize={20}>
258-
<TabPanels w="full" h="full">
257+
<Panel id="main-panel" order={1} minSize={20}>
258+
<TabPanels w="full" h="full" position="relative">
259259
{tabPanels}
260+
<ImageViewer />
260261
</TabPanels>
261-
<ImageViewer />
262262
</Panel>
263263
{shouldShowGalleryPanel && (
264264
<>

0 commit comments

Comments
 (0)