From 9e0774d84e7c066968f94212e69004795241f599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Metehan=20=C3=96zyurt?= Date: Mon, 4 Apr 2022 22:36:46 +0300 Subject: [PATCH 1/2] Pdf preview is in centered --- src/styles/styles.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index d095b16fd49a..992d7697b6ad 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1691,14 +1691,14 @@ const styles = { backgroundColor: themeColors.modalBackground, }, PDFView: { - flex: 1, + display: 'grid', backgroundColor: themeColors.modalBackground, width: '100%', height: '100%', - flexDirection: 'row', justifyContent: 'center', overflow: 'hidden', overflowY: 'auto', + alignItems: 'center', }, modalCenterContentContainer: { From 957f38ae566833a682360165b9774e4a9637a2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Metehan=20=C3=96zyurt?= Date: Tue, 5 Apr 2022 21:53:04 +0300 Subject: [PATCH 2/2] Added comment about 'display: grid' --- src/styles/styles.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/styles/styles.js b/src/styles/styles.js index 992d7697b6ad..ce03535fc1fc 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -1691,6 +1691,9 @@ const styles = { backgroundColor: themeColors.modalBackground, }, PDFView: { + // `display: grid` is not supported in native platforms! + // It's being used on Web/Desktop only to vertically center short PDFs, + // while preventing the overflow of the top of long PDF files. display: 'grid', backgroundColor: themeColors.modalBackground, width: '100%',