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

[plugin-web-app] Fix scrolling of element into view from non-initial window position #4846

Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -17,7 +17,7 @@ try {
currentWindow = currentWindow.parent;
}
currentWindow.addEventListener('scroll', clearTimeoutAndWait, false);
currentWindow.scrollBy(0, elementToScroll.getBoundingClientRect().top - currentWindow.innerHeight * stickyHeaderSize);
currentWindow.scrollBy(0, elementToScroll.getBoundingClientRect().top - currentWindow.scrollY - currentWindow.innerHeight * stickyHeaderSize);
}
catch(e) {
// swallow error quietly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,8 @@ Scenario: Scroll TOP for page Verify step: When I scroll context to $scrollDirec
When I scroll context to TOP edge
When I execute javascript `return document.documentElement.scrollTop` and save result to scenario variable `scroll`
Then `${scroll}` is = `0`

Scenario: Validate scrolling of element into view when window scroll is not in the initial position
Given I am on page with URL `${vividus-test-site-url}/hugeStickyHeader.html`
When I scroll element located by `id(target)` into view
When I click on element located by `id(click-me)`
Loading