-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Prevent page scroll jumping when product gallery loads #25385
Prevent page scroll jumping when product gallery loads #25385
Conversation
During the investigation of the issue linked below I was able to pinpoint the exact moment of scroll jumping to fotorama's `that.resize` function which for some reason resets all of its major elements' width and height dimensions. I analysed the code and concluded that since current element height seems to be completely ignored in the whole script and is only set either based on settings or its width and ratio, the code that resets it can be removed. Please not that this can be also true for width but I left it here just to be safe as it doesn't contribute to page jumping. In addition, `min-height` was added to prevent initial jump of the gallery when static image is being replaced by fotorama's HTML. Fixes magento#10518.
Hi @krzksz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@magento give me test instance |
Hi @rodrigowebjump. Thank you for your request. I'm working on Magento instance for you |
Hi @rodrigowebjump, here is your new Magento instance. |
@magento give me 2.3-develop instance |
Hi @rodrigowebjump. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @rodrigowebjump, here is your Magento instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @krzksz
Thanks for your contribution
Hi @rodrigowebjump, thank you for the review.
|
@magento run all tests |
Hi @krzksz Please cover your fix with unit test |
I will take care of test coverage |
…o fix-product-gallery-jumping
@magento run all tests |
Hi @rodrigowebjump, thank you for the review. |
✔️ QA passed |
Hi @krzksz, thank you for your contribution! |
Description (*)
During the investigation of the issue linked below I was able to pinpoint the exact moment of scroll jumping to fotorama's
that.resize
function which for some reason resets all of its major elements' width and height dimensions. I analysed the code and concluded that since current element height seems to be completely ignored in the whole script and is only set either based on settings or its width and ratio, the code that resets it can be removed. Please not that this can be also true for width but I left it here just to be safe as it doesn't contribute to page jumping.In addition,
min-height
was added to prevent initial jump of the gallery when static image is being replaced by fotorama's HTML.Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Please be sure to test this change on multiple browsers and devices including resizing the window through different resolutions as fotorama's configuration changes between breakpoins.
Contribution checklist (*)