-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Changed logic so that _scrollToTopIfVisible is called only if element is in viewport. Previously it was called only when the element was outside it. #23390
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
Conversation
… is in viewport. Previously it was called only when the element was outside it. Also changed the logic of _isElementOutOfViewport to work correctly.
… is in viewport. Previously it was called only when the element was outside it. Also changed the logic of _isElementOutOfViewport to work correctly.
Hi @oskarolaussen. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
… element is in viewport. Previously it was called only when the element was outside it. Also changed the logic of _isElementOutOfViewport to work correctly." This reverts commit b5f2357.
Hi @oskarolaussen , looks like you made some commits with email different than in your GitHub profile, please, add email from commits to your profile! |
Hi @sidolov! Commits should now be correctly attributed to me. |
…ic worked correctly
I reverted _isElementOutOfViewport to how it was originally as it worked correctly. I had my coordinate system mixed up. Sorry! Edited the title and description accordingly. But the fix for _scrollToTopIfVisible should still be valid. |
Hi @sidolov, thank you for the review. |
@oskarolaussen thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
✔️ QA passed |
…ly if element is in viewport. Previously it was called only when the element was outside it. magento#23390
Hi @oskarolaussen, thank you for your contribution! |
@magento-engcom-team I think this PR should be reverted.
|
p.s. Do you realize that now scroll will not work when the element is outside of the viewport? |
I encountered a situation where the previous function caused undesired behaviour and since the name didn't match the logic I decided to "fix" it. As it seems to cause more problems than it fixes I'm fully onboard with reverting this PR. Sorry about the inconvenience. |
Description (*)
Noticed that _scrollToTopIfVisible was called only if changing element was outside of viewport and thus wasn't working as intended.
Fixed Issues (if relevant)
Manual testing scenarios (*)
On product page scroll so that .product.data.items is partially visible.
Change tab. The whole .product.data.items should scroll into view.
Questions or comments
Contribution checklist (*)