Skip to content

Commit

Permalink
Bugfix FXIOS-7497 [v121] Fix scroll bug (backport #18048) (#18057)
Browse files Browse the repository at this point in the history
* Bugfix FXIOS-7497 [v121] Fix scroll bug (#18048)

(cherry picked from commit e9210c5)

# Conflicts:
#	Client/Frontend/Browser/TabScrollController.swift

* Fix conflict

---------

Co-authored-by: OrlaM <omitchell@mozilla.com>
  • Loading branch information
mergify[bot] and OrlaM committed Jan 9, 2024
1 parent 0cf3402 commit 2313060
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 @@ -806,7 +806,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 @@ -1358,6 +1358,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
3 changes: 2 additions & 1 deletion Client/Frontend/Browser/TabScrollController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,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 @@ -329,6 +329,7 @@ private extension TabScrollingController {
}

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

0 comments on commit 2313060

Please sign in to comment.