mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
sliding on inactive slide on click instead of opening it
This commit is contained in:
parent
507bb452bb
commit
e8f4412bfc
1 changed files with 5 additions and 0 deletions
|
@ -45,6 +45,11 @@ const NodeImageSwiperBlock: FC<IProps> = ({ node }) => {
|
||||||
|
|
||||||
const onOpenPhotoSwipe = useCallback(
|
const onOpenPhotoSwipe = useCallback(
|
||||||
(index: number) => {
|
(index: number) => {
|
||||||
|
if (index !== controlledSwiper?.activeIndex && controlledSwiper?.slideTo) {
|
||||||
|
controlledSwiper.slideTo(index, 300);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dispatch(modalShowPhotoswipe(images, index));
|
dispatch(modalShowPhotoswipe(images, index));
|
||||||
},
|
},
|
||||||
[dispatch, images, controlledSwiper]
|
[dispatch, images, controlledSwiper]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue