Skip to content

Commit 039ab2f

Browse files
authored
Merge pull request #17 from dashpay/fix/bottom-sheet-keyboard-inset
fix(bottom-sheet): stop swallowing the keyboard inset
2 parents 83cf65a + 434ae3c commit 039ab2f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎Sources/DashUIKit/Components/BottomSheet/BottomSheet.swift‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ public struct BottomSheet<Content: View>: View {
7575

7676
Group {
7777
if fillsHeight {
78-
sheet.edgesIgnoringSafeArea(.bottom)
78+
// `.container` rather than every region: the point is to let the
79+
// sheet's background run under the home indicator, and
80+
// `edgesIgnoringSafeArea` — like `ignoresSafeArea(.all)` — also
81+
// swallows `.keyboard`, which switches off SwiftUI's keyboard
82+
// avoidance for the whole sheet. Hosts with a text field then
83+
// find their content pinned under the keyboard with no way to
84+
// scroll to it.
85+
sheet.ignoresSafeArea(.container, edges: .bottom)
7986
} else {
8087
// Publish the natural content height for `.selfSizingSheet()`. The bottom safe area is
8188
// intentionally NOT ignored here, so the measured height excludes the home-indicator

0 commit comments

Comments
 (0)