Skip to content

Commit

Permalink
Bugfix FXIOS-7497 [v121] Fix scroll bug (#18048)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrlaM committed Jan 9, 2024
1 parent 86ad3ad commit e9210c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,6 @@ extension BrowserViewController: WKNavigationDelegate {
self.scrollController.resetZoomState()

if tabManager.selectedTab === tab {
self.scrollController.showToolbars(animated: false)
updateUIForReaderHomeStateForTab(tab, focusUrlBar: true)
updateFakespot(tab: tab)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,7 @@ class BrowserViewController: UIViewController,

func updateUIForReaderHomeStateForTab(_ tab: Tab, focusUrlBar: Bool = false) {
updateURLBarDisplayURL(tab)
scrollController.showToolbars(animated: false)

if let url = tab.url {
if url.isReaderModeURL {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ private extension TabScrollingController {
completion: ((_ finished: Bool) -> Void)?) {
guard let scrollView = scrollView else { return }
contentOffsetBeforeAnimation = scrollView.contentOffset
isAnimatingToolbar = true

// If this function is used to fully animate the toolbar from hidden to shown, keep the page from scrolling
// by adjusting contentOffset, otherwise when the toolbar is hidden and a link navigated, showing the toolbar
// will scroll the page and produce a ~50px page jumping effect in response to tap navigations.
Expand All @@ -337,6 +337,7 @@ private extension TabScrollingController {
}

if animated {
isAnimatingToolbar = true
UIView.animate(withDuration: duration,
delay: 0,
options: .allowUserInteraction,
Expand Down

0 comments on commit e9210c5

Please sign in to comment.