mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-22 10:36:57 +00:00
Work around Safari 15's incomplete support for dvh units (#19567)
GitOrigin-RevId: ff6429d6a918413857dd8116611c9857958f68ed
This commit is contained in:
parent
4af10054df
commit
8821a6d2f4
1 changed files with 16 additions and 0 deletions
|
@ -4,3 +4,19 @@ import ReactDOM from 'react-dom'
|
|||
import IdeRoot from '@/features/ide-react/components/ide-root'
|
||||
|
||||
ReactDOM.render(<IdeRoot />, document.getElementById('ide-root'))
|
||||
|
||||
// work around Safari 15's incomplete support for dvh units
|
||||
// https://github.com/overleaf/internal/issues/18109
|
||||
try {
|
||||
if (
|
||||
document.body.parentElement &&
|
||||
document.body.parentElement?.clientHeight < document.body.clientHeight
|
||||
) {
|
||||
const rootElement = document.querySelector<HTMLDivElement>('#ide-root')
|
||||
if (rootElement) {
|
||||
rootElement.style.height = '100vh'
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// ignore errors
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue