1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fixed swiper default width to 100%

This commit is contained in:
Fedor Katurov 2022-06-20 10:42:08 +07:00
parent 254f9c7af0
commit 2c39fcda25
2 changed files with 8 additions and 5 deletions

View file

@ -53,11 +53,10 @@ const NodeImageSwiperBlock: FC<IProps> = observer(({ node }) => {
[images, controlledSwiper, showPhotoSwiper]
);
// TODO: remove it if swiper 8 fixed sliding to first slide on init
// useEffect(() => {
// controlledSwiper?.slideTo(0, 0);
// return () => controlledSwiper?.slideTo(0, 0);
// }, [images, node?.id]);
useEffect(() => {
controlledSwiper?.slideTo(0, 0);
return () => controlledSwiper?.slideTo(0, 0);
}, [images, node?.id]);
useEffect(() => {
if (isModalActive) {