fix(android): adjust depth sheet top offset for android compatibility

This commit is contained in:
charlie
2025-09-08 16:42:17 +08:00
parent cd2cf2c944
commit 97634a44a7
2 changed files with 7 additions and 1 deletions

View File

@@ -103,7 +103,9 @@ SheetWithDepthStackRoot.displayName = 'SheetWithDepthStack.Root'
// The SheetStack outlets that define the scenery of the stack
// (i.e. the content underneath) for the depth effect.
const initialTopOffset = 'max(env(safe-area-inset-top), 1.3vh)'
const isIOS = window.navigator.userAgent?.match(/iPhone|iPad/i)
const initialTopOffset = isIOS ?
'max(env(safe-area-inset-top), 1.3vh)' : 'max(var(--safe-area-inset-top), 1.3vh)'
const SheetWithDepthStackSceneryOutlets = React.forwardRef<
React.ElementRef<typeof SheetStack.Outlet>,

View File

@@ -38,6 +38,10 @@ html.is-native-android {
padding-top: calc(var(--safe-area-inset-top) + 14px);
}
}
.SheetWithDepth-content {
height: calc(100% - max(calc(var(--safe-area-inset-top) + 1.3vh), 2.6vh));
}
}
#main-container {