-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
bug: use placeholder in carousel while loading next image #1085
Conversation
This pull request is automatically deployed with Now. |
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.
Nice improvement. Discussed slight flash of placeholder with Stephen when switching between swatch colors, but fixing that would require a larger re-factor of the carousel component that doesn't seem necessary in this scope. Comfortable merging this as-is, and iterate on the slight flash in a future issue.
Description
The carousel just uses a simple
<img>
tag to load the images on the PDP. There is a moment that, depending on network speed, we jutter the page while loading a variant or new image. This PR handles that by adding anonLoad
handler and some local state to the carousel class so that we render a placeholder while loading the image.One thing I wasn't sure about was how the transparent placeholder we created in
shared/images.js
is styled or sized. It seems to render a few pixels larger than the actual image so there is still a slight jutter while we draw. That being said, this PR makes it much less jarring.Related Issue
Closes #1084.
Verification Steps
How Have YOU Tested this?
I did the above.
Screenshots / Screen Captures (if appropriate):
My gif capture tool doesn't have a high enough fps to capture the jutter...:cry:
Proposed Labels for Change Type/Package
Checklist: