diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e62cbc..51e941e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ BottomSheet adheres to [Semantic Versioning](http://semver.org/). ### Changed +Fix half-opened bottom sheet when returning from background. + - 1.0.6 Removing List padding on examples. diff --git a/Sources/BottomSheet/BottomSheet.swift b/Sources/BottomSheet/BottomSheet.swift index d4b136b..4828d85 100644 --- a/Sources/BottomSheet/BottomSheet.swift +++ b/Sources/BottomSheet/BottomSheet.swift @@ -91,7 +91,10 @@ public struct BottomSheet: View { .gesture( DragGesture() .onChanged({ (value) in - + // ignore the swipe-up gesture which could collide with the iOS-global "go to homescreen"-gesture + let isSwipeUp = value.startLocation.y > value.location.y + if isPresented == false, isSwipeUp { return } + let offsetY = value.translation.height self.draggedOffset = offsetY