Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix FXIOS-7497 [v121] Fix scroll bug #18048

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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