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

#23 fixed swiper crash

This commit is contained in:
Fedor Katurov 2021-03-22 18:00:53 +07:00
parent e44ad8e5c2
commit 2b2464b8dd

View file

@ -45,7 +45,9 @@ const NodeImageSwiperBlock: FC<IProps> = ({ node }) => {
const resetSwiper = useCallback(() => {
if (!controlledSwiper) return;
controlledSwiper.slideTo(0, 0);
setTimeout(() => controlledSwiper.slideTo(0, 0), 300);
// TODO: replace with working one
// setTimeout(() => controlledSwiper.slideTo(0, 0), 300);
}, [controlledSwiper]);
useEffect(() => {
@ -63,7 +65,7 @@ const NodeImageSwiperBlock: FC<IProps> = ({ node }) => {
}
return (
<div className={styles.wrapper}>
<div className={styles.wrapper} key={node.id}>
<Swiper
initialSlide={0}
slidesPerView="auto"