Skip to content

Commit d1e3214

Browse files
committed
Fix PDF viewer for mobile browsers - replace object/embed with iframe
1 parent eff759d commit d1e3214

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

src/components/public/FilePreviewModal.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -308,27 +308,17 @@ export default function FilePreviewModal({ file, onClose }: FilePreviewModalProp
308308

309309
{isPdf && (
310310
<div style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column" }}>
311-
<object
312-
data={file.fileUrl}
313-
type="application/pdf"
311+
<iframe
312+
src={file.fileUrl}
314313
style={{
315314
width: "100%",
316315
height: "100%",
317316
border: "none",
318317
borderRadius: "8px",
319318
boxShadow: "0 20px 50px rgba(0,0,0,0.5)"
320319
}}
321-
>
322-
<embed
323-
src={file.fileUrl}
324-
type="application/pdf"
325-
style={{
326-
width: "100%",
327-
height: "100%",
328-
border: "none"
329-
}}
330-
/>
331-
</object>
320+
title={file.title}
321+
/>
332322
</div>
333323
)}
334324

0 commit comments

Comments
 (0)