Skip to content

Commit 194434d

Browse files
Mary Hipppsychedelicious
authored andcommitted
restore scrollbar
1 parent 8cb1957 commit 194434d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

invokeai/frontend/web/src/features/gallery/components/ImageGrid/GalleryImageGrid.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ const GalleryImageGrid = () => {
118118
);
119119
}, [dispatch, imageNames.length, galleryView]);
120120

121+
useEffect(() => {
122+
// Set up gallery scroler
123+
const { current: root } = rootRef;
124+
if (scroller && root) {
125+
initialize({
126+
target: root,
127+
elements: {
128+
viewport: scroller,
129+
},
130+
});
131+
}
132+
return () => osInstance()?.destroy();
133+
}, [scroller, initialize, osInstance]);
134+
121135
const handleEndReached = useMemo(() => {
122136
if (areMoreAvailable) {
123137
return handleLoadMoreImages;

0 commit comments

Comments
 (0)