Skip to content

Conversation

@patrickhulce
Copy link
Collaborator

Summary
Came up a few times now, but we should give gatherers a consistent view of the page. This PR saves the scroll position of the page after we're done loading and scrolls back to it after every gatherer.

Related Issues/PRs
#7778 (comment)

Copy link
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a good idea? I don't see strong downsides. Is scrollTo a no-op if scrolling to where the page already is?


// Some gatherers scroll the page which can cause unexpected results for other gatherers.
// We reset the scroll position in between each gatherer.
const scrollPosition = pageLoadError ? null : await driver.getScrollPosition();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pageLoadError control flow is seriously the worst :S

@paulirish
Copy link
Member

let's land this after we ship 5.0.0

@patrickhulce
Copy link
Collaborator Author

patrickhulce commented May 20, 2019

let's land this after we ship 5.0.0

It is now post-5.0.0, reviews welcome :)

@paulirish paulirish merged commit 6bc4f89 into master May 25, 2019
@paulirish paulirish deleted the reset_scroll_position branch May 25, 2019 05:21
@brendankenny
Copy link
Contributor

yeah, no, bad merge, bad :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants