mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-25 18:55:44 +03:00
Fix carousel not scrolling
This commit is contained in:
parent
5e2d084854
commit
15e4012dd2
1 changed files with 1 additions and 1 deletions
|
@ -55,11 +55,11 @@ function MediaModal({
|
||||||
const scrollLeft = index * carouselRef.current.clientWidth;
|
const scrollLeft = index * carouselRef.current.clientWidth;
|
||||||
const differentStatusID = prevStatusID.current !== statusID;
|
const differentStatusID = prevStatusID.current !== statusID;
|
||||||
if (differentStatusID) prevStatusID.current = statusID;
|
if (differentStatusID) prevStatusID.current = statusID;
|
||||||
|
carouselRef.current.focus();
|
||||||
carouselRef.current.scrollTo({
|
carouselRef.current.scrollTo({
|
||||||
left: scrollLeft * (isRTL() ? -1 : 1),
|
left: scrollLeft * (isRTL() ? -1 : 1),
|
||||||
behavior: differentStatusID ? 'auto' : 'smooth',
|
behavior: differentStatusID ? 'auto' : 'smooth',
|
||||||
});
|
});
|
||||||
carouselRef.current.focus();
|
|
||||||
}, [index, statusID]);
|
}, [index, statusID]);
|
||||||
|
|
||||||
const [showControls, setShowControls] = useState(true);
|
const [showControls, setShowControls] = useState(true);
|
||||||
|
|
Loading…
Reference in a new issue