Fix a stray misplaced height that seemingly tripped iOS safari on device but not in sim?
This commit is contained in:
parent
e3856c0984
commit
4a33262da0
2 changed files with 4 additions and 4 deletions
|
|
@ -14,11 +14,12 @@ export default function ViewerPanel({className, style}: {className?: string, sty
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}
|
<div className={className}
|
||||||
style={{display: 'flex', flexDirection: 'column',
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
flex: 1,
|
flex: 1,
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
|
||||||
...(style ?? {})
|
...(style ?? {})
|
||||||
}}>
|
}}>
|
||||||
{state.output?.stlFileURL &&
|
{state.output?.stlFileURL &&
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,7 @@ export function formatMillis(n: number) {
|
||||||
// https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8
|
// https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8
|
||||||
export function registerCustomAppHeightCSSProperty() {
|
export function registerCustomAppHeightCSSProperty() {
|
||||||
const updateAppHeight = () => {
|
const updateAppHeight = () => {
|
||||||
const doc = document.documentElement
|
document.documentElement.style.setProperty('--app-height', `${window.innerHeight}px`)
|
||||||
doc.style.setProperty('--app-height', `${window.innerHeight}px`)
|
|
||||||
}
|
}
|
||||||
window.addEventListener('resize', updateAppHeight)
|
window.addEventListener('resize', updateAppHeight)
|
||||||
updateAppHeight();
|
updateAppHeight();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue