Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Ref #3838: Fix overall menu height on smaller devices (#3850)
Browse files Browse the repository at this point in the history
PanModal uses `topOffset` to determine the height of the presenting controller rather than the `longFormHeight`, so adjusting where I add that 32pt's for accessibility to fix the bug caused by adding that 32pt's in the wrong location.
  • Loading branch information
kylehickinson authored Jun 25, 2021
1 parent a970e62 commit e417f20
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"package": "PanModal",
"repositoryURL": "https://github.com/brave/PanModal",
"state": {
"branch": "master",
"branch": null,
"revision": "e4c07f8e6c5df937051fabc47e1e92901e1d068b",
"version": null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,15 @@ extension MenuViewController: PanModalPresentable {
topVC.view.layoutIfNeeded()
return _scrollViewChild(in: topVC.view)
}
var topOffset: CGFloat {
let topInset = view.window?.safeAreaInsets.top ?? 0
return topInset + 32
}
var longFormHeight: PanModalHeight {
.maxHeightWithTopInset(32)
.maxHeight
}
var shortFormHeight: PanModalHeight {
isPresentingInnerMenu ? .maxHeightWithTopInset(32) : .contentHeight(initialHeight)
isPresentingInnerMenu ? .maxHeight : .contentHeight(initialHeight)
}
var allowsExtendedPanScrolling: Bool {
true
Expand Down

0 comments on commit e417f20

Please sign in to comment.