Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: also for horizontal and image

Marc Seitzbf77d2b2c252
diff --git a/components/view/viewer/image-viewer.tsx b/components/view/viewer/image-viewer.tsx
index 97e3b623..df0e2ea8 100644
--- a/components/view/viewer/image-viewer.tsx
+++ b/components/view/viewer/image-viewer.tsx
@@ -323,20 +323,11 @@ export default function ImageViewer({
)}
ref={containerRef}
>
- <div
- className={cn(
- "h-full w-full",
- scale > 1 && "overflow-auto",
- isMobile && "touch-zoom-container",
- )}
- >
+ <div className={cn("h-full w-full", scale > 1 && "overflow-auto")}>
<div
- className={cn(
- "flex min-h-full w-full items-center justify-center",
- isMobile && "touch-action-pinch-zoom",
- )}
+ className="flex min-h-full w-full items-center justify-center"
style={{
- transform: isMobile ? "none" : `scale(${scale})`,
+ transform: `scale(${scale})`,
transition: "transform 0.2s ease-out",
transformOrigin: scale <= 1 ? "center center" : "left top",
minWidth: scale > 1 ? `${100 * scale}%` : "100%",
@@ -345,10 +336,7 @@ export default function ImageViewer({
>
<div className="relative my-auto flex w-full justify-center">
<img
- className={cn(
- "!pointer-events-auto max-h-[calc(100dvh-64px)] object-contain",
- isMobile && "touch-action-pinch-zoom",
- )}
+ className="!pointer-events-auto max-h-[calc(100dvh-64px)] object-contain"
ref={(ref) => {
imageRefs.current = ref;
if (ref) {
diff --git a/components/view/viewer/pages-horizontal-viewer.tsx b/components/view/viewer/pages-horizontal-viewer.tsx
index 1a30a2b2..2df80b07 100644
--- a/components/view/viewer/pages-horizontal-viewer.tsx
+++ b/components/view/viewer/pages-horizontal-viewer.tsx
@@ -590,20 +590,11 @@ export default function PagesHorizontalViewer({
)}
ref={containerRef}
>
- <div
- className={cn(
- "h-full w-full",
- scale > 1 && "overflow-auto",
- isMobile && "touch-zoom-container",
- )}
- >
+ <div className={cn("h-full w-full", scale > 1 && "overflow-auto")}>
<div
- className={cn(
- "flex min-h-full w-full items-center justify-center",
- isMobile && "touch-action-pinch-zoom",
- )}
+ className="flex min-h-full w-full items-center justify-center"
style={{
- transform: isMobile ? "none" : `scale(${scale})`,
+ transform: `scale(${scale})`,
transition: "transform 0.2s ease-out",
transformOrigin: scale <= 1 ? "center center" : "left top",
minWidth: scale > 1 ? `${100 * scale}%` : "100%",
@@ -626,7 +617,6 @@ export default function PagesHorizontalViewer({
<img
className={cn(
"!pointer-events-auto max-h-[calc(100dvh-64px)] object-contain",
- isMobile && "touch-action-pinch-zoom",
)}
ref={(ref) => {
imageRefs.current[index] = ref;