@@ -61,15 +61,19 @@ public struct BottomSheet<Content: View>: View {
6161Spacer ( )
6262}
6363}
64- . frame ( height: self . height - min( self . draggedOffset*2, 0 ) )
64+ . frame ( height: sheetHeight ( in : geometry ) - min( self . draggedOffset*2, 0 ) )
6565. background ( self . contentBackgroundColor)
6666. cornerRadius ( self . topBarCornerRadius, corners: [ . topLeft, . topRight] )
6767. animation ( . interactiveSpring( ) )
68- . offset ( y: self . isPresented? ( geometry. size. height/ 2 - self . height / 2 + geometry. safeAreaInsets. bottom+ self . draggedOffset) : ( geometry. size. height/ 2 + self . height / 2 + geometry. safeAreaInsets. bottom) )
68+ . offset ( y: self . isPresented? ( geometry. size. height/ 2 - sheetHeight ( in : geometry ) / 2 + geometry. safeAreaInsets. bottom+ self . draggedOffset) : ( geometry. size. height/ 2 + sheetHeight ( in : geometry ) / 2 + geometry. safeAreaInsets. bottom) )
6969}
7070}
7171}
7272
73+ fileprivate func sheetHeight( geometry in: GeometryProxy ) -> CGFloat {
74+ return min ( self . height, geometry. size. height)
75+ }
76+
7377fileprivate func fullScreenLightGrayOverlay( ) -> some View {
7478Color
7579. black