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:
parent
e44ad8e5c2
commit
2b2464b8dd
1 changed files with 4 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue