Skip to content

Commit fe4c784

Browse files
committed
Fix mobile PDF scrolling with touch-friendly container
1 parent b1562f5 commit fe4c784

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

src/components/public/FilePreviewModal.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -305,17 +305,20 @@ export default function FilePreviewModal({ file, onClose }: FilePreviewModalProp
305305
)}
306306

307307
{isPdf && (
308-
<iframe
309-
src={`https://docs.google.com/viewer?url=${encodeURIComponent(file.fileUrl)}&embedded=true`}
310-
style={{
311-
width: "100%",
312-
height: "100%",
313-
border: "none",
314-
background: "white",
315-
borderRadius: "8px",
316-
boxShadow: "0 20px 50px rgba(0,0,0,0.5)"
317-
}}
318-
/>
308+
<div style={{ width: "100%", height: "100%", overflowY: "auto", WebkitOverflowScrolling: "touch" }}>
309+
<iframe
310+
src={`https://docs.google.com/viewer?url=${encodeURIComponent(file.fileUrl)}&embedded=true`}
311+
style={{
312+
width: "100%",
313+
height: "100%",
314+
border: "none",
315+
background: "white",
316+
borderRadius: "8px",
317+
boxShadow: "0 20px 50px rgba(0,0,0,0.5)",
318+
display: "block"
319+
}}
320+
/>
321+
</div>
319322
)}
320323

321324
{isOfficeDoc && (

0 commit comments

Comments
 (0)