From dc1f2c42898ed1a43b68549755556fd0e723a959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20Dre=C3=9Fler?= Date: Wed, 27 Nov 2024 11:38:00 +0100 Subject: [PATCH] fix: swipe behavior in non-webkit browsers closes #200 --- packages/react-photo-view/src/Photo.less | 2 +- packages/react-photo-view/src/Photo.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-photo-view/src/Photo.less b/packages/react-photo-view/src/Photo.less index 01d9050..dcabb27 100644 --- a/packages/react-photo-view/src/Photo.less +++ b/packages/react-photo-view/src/Photo.less @@ -1,7 +1,7 @@ .PhotoView__Photo { max-width: initial; - -webkit-user-drag: none; cursor: grab; + user-select: none; &:active { cursor: grabbing; diff --git a/packages/react-photo-view/src/Photo.tsx b/packages/react-photo-view/src/Photo.tsx index edc66a8..8d26018 100644 --- a/packages/react-photo-view/src/Photo.tsx +++ b/packages/react-photo-view/src/Photo.tsx @@ -59,11 +59,16 @@ export default function Photo({ src={src} onLoad={handleImageLoaded} onError={handleImageBroken} + draggable={false} alt="" {...restProps} /> {!loaded && - ({loadingElement} || )} + (loadingElement ? ( + {loadingElement} + ) : ( + + ))} ); }