From 2183b6853bada1fc379caa7c0d536585bde1bc1a Mon Sep 17 00:00:00 2001 From: Alexey Kostenko Date: Mon, 21 Dec 2020 13:40:55 +0300 Subject: [PATCH] Web: Files: DocEditor: Fixed page height detection --- .../src/components/pages/DocEditor/index.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/products/ASC.Files/Client/src/components/pages/DocEditor/index.js b/products/ASC.Files/Client/src/components/pages/DocEditor/index.js index b053004cec..16d92c1d79 100644 --- a/products/ASC.Files/Client/src/components/pages/DocEditor/index.js +++ b/products/ASC.Files/Client/src/components/pages/DocEditor/index.js @@ -2,6 +2,7 @@ import React from "react"; import { withRouter } from "react-router"; import { Toast, Box } from "asc-web-components"; import { utils, api, toastr, Loaders } from "asc-web-common"; +import { isIOS, deviceType } from "react-device-detect"; const { getObjectByLocation, showLoader, hideLoader, tryRedirectTo } = utils; @@ -28,8 +29,10 @@ class PureEditor extends React.Component { console.log("PureEditor componentDidMount", fileId, doc); - const vh = window.innerHeight * 0.01; - document.documentElement.style.setProperty("--vh", `${vh}px`); + if (this.isIPad()) { + const vh = window.innerHeight * 0.01; + document.documentElement.style.setProperty("--vh", `${vh}px`); + } showLoader(); @@ -87,9 +90,16 @@ class PureEditor extends React.Component { } }; + isIPad = () => { + return isIOS && deviceType === "tablet"; + }; + render() { return ( - + {!this.state.isLoading ? (