Fix gallery not resizing correctly on open and close

This commit is contained in:
blessedcoolant 2022-11-22 16:00:58 +13:00
parent 93de78b6e8
commit 9a6a970771

View File

@ -117,7 +117,8 @@ export default function ImageGallery() {
const handleOpenGallery = () => {
dispatch(setShouldShowGallery(true));
shouldPinGallery && dispatch(setDoesCanvasNeedScaling(true));
shouldPinGallery &&
setTimeout(() => dispatch(setDoesCanvasNeedScaling(true)), 400);
};
const handleCloseGallery = useCallback(() => {
@ -128,6 +129,7 @@ export default function ImageGallery() {
galleryContainerRef.current ? galleryContainerRef.current.scrollTop : 0
)
);
setTimeout(() => dispatch(setDoesCanvasNeedScaling(true)), 400);
}, [dispatch]);
const handleClickLoadMore = () => {