Extend swipe functionality.
This commit is contained in:
parent
1a05b353e6
commit
6ca16fae77
|
@ -96,10 +96,17 @@ const PresentNavigationOverlay = ({
|
|||
}, [])
|
||||
|
||||
const handlers = useSwipeable({
|
||||
onSwipedDown: () => {
|
||||
if (disableSaveCloseInHistory === true) {
|
||||
dispatchMedia({ type: 'closePresentMode' })
|
||||
} else {
|
||||
closePresentModeAction({ dispatchMedia })
|
||||
}
|
||||
},
|
||||
onSwipedLeft: () => dispatchMedia({ type: 'nextImage' }),
|
||||
onSwipedRight: () => dispatchMedia({ type: 'previousImage' }),
|
||||
preventScrollOnSwipe: false,
|
||||
trackMouse: false,
|
||||
trackMouse: true,
|
||||
})
|
||||
|
||||
return (
|
||||
|
@ -109,7 +116,7 @@ const PresentNavigationOverlay = ({
|
|||
onMouseMove.current && onMouseMove.current()
|
||||
}}
|
||||
>
|
||||
<div {...handlers}>
|
||||
<div {...handlers} data-testid="swipe-component">
|
||||
{children}
|
||||
<NavigationButton
|
||||
aria-label="Previous image"
|
||||
|
|
Loading…
Reference in New Issue