Skip to content

Commit

Permalink
fix(Viewer): Events must be limited on the image
Browse files Browse the repository at this point in the history
On mobile, the events must not be on the entire page,
otherwise the back arrow also triggers the download for example.
  • Loading branch information
Merkur39 committed Mar 20, 2024
1 parent 0053f15 commit 548994d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion react/Viewer/ViewersByFile/PdfMobileViewer.jsx
Expand Up @@ -51,7 +51,10 @@ export const PdfMobileViewer = ({ file, url, t, gestures }) => {
if (gestures) {
gestures.get('pinch').set({ enable: true })
gestures.on('pinchend tap', evt => {
if (evt.type === 'pinchend' || evt.tapCount === 1) {
if (
(evt.type === 'pinchend' || evt.tapCount === 1) &&
evt.target === imgRef.current
) {
handleOnClick(file)
}
})
Expand Down

0 comments on commit 548994d

Please sign in to comment.