Skip to content

Commit

Permalink
Use view bounds instead of view frame when calculating offset (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
nodes11 authored Jan 13, 2025
1 parent 33e8f2e commit a73a822
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1038,16 +1038,16 @@ public class BottomSheetController: UIViewController, Shadowable, TokenizedContr
switch expansionState {
case .collapsed:
if !isHeightRestricted || !isExpandable {
offset = view.frame.maxY - collapsedSheetHeight
offset = view.bounds.maxY - collapsedSheetHeight
} else {
// When we're height restricted a distinct collapsed offset doesn't make sense,
// so we go straight to expanded.
fallthrough
}
case .expanded:
offset = view.frame.maxY - expandedSheetHeight
offset = view.bounds.maxY - expandedSheetHeight
case .hidden:
offset = view.frame.maxY
offset = view.bounds.maxY
case .transitioning:
offset = bottomSheetView.frame.minY
}
Expand Down

0 comments on commit a73a822

Please sign in to comment.