Skip to content

Commit

Permalink
Fixed crash where minWidth in greater than available width while shee…
Browse files Browse the repository at this point in the history
…t is animating (#2110)
  • Loading branch information
cbowdoin authored Dec 17, 2024
1 parent d7f954b commit 5f65631
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -871,13 +871,15 @@ public class BottomSheetController: UIViewController, Shadowable, TokenizedContr
let availableWidth: CGFloat = view.bounds.width
let maxWidth = min(Constants.maxSheetWidth, availableWidth)
let determinedWidth: CGFloat

if shouldAlwaysFillWidth {
determinedWidth = availableWidth
} else if Constants.minSheetWidth...maxWidth ~= preferredWidth {
determinedWidth = preferredWidth
} else if maxWidth > Constants.minSheetWidth {
determinedWidth = Constants.minSheetWidth...maxWidth ~= preferredWidth ? preferredWidth : maxWidth
} else {
determinedWidth = maxWidth
}

return determinedWidth
}

Expand Down

0 comments on commit 5f65631

Please sign in to comment.