-
Notifications
You must be signed in to change notification settings - Fork 219
Product Gallery: Add animation when large image changes #11113
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
assets/js/blocks/product-gallery/inner-blocks/product-gallery-large-image/frontend.tsx
|
Size Change: +317 B (0%) Total Size: 1.54 MB
ℹ️ View Unchanged
|
3cf02f0
to
af4282f
Compare
* Add titles to patterns and set the aligment to Wide * Replace product query patterns with product collection ones * Remove pagination and no results query from product query patterns * Add aspect ratio to the product image attributes * Add portrait aspect ratio to product X column and product gallery patterns
af4282f
to
ea0b1f5
Compare
…erce-blocks into fix/animation-dialog
Bumping this PR to next release. |
It seems to be working mostly fine with the "outside" button setting (the height of the Large Image is static though): |
…o fix/animation-dialog
Both potential issues are correlated. With the current implementation, the row of images is handled by Flexbox. The highest image sets the height. I think that this approach is the right one because the position of the arrow has to be fixed and not be dependent by the width/height of the image like currently happens on trunk: Screen.Capture.Oct.12.mp4I think that when "image cropping" is enabled, we can force all the images to have the maximum width and height available. When it is disabled, could we center the image? What do you think? Screen.Capture.Oct.16.mov |
|
Hey @jarekmorawski, could you give us feedback on this change, please? You can take a look to this comment. Personally, I think that the behavior in the first video is wrong, and we should stick with the second behavior (maybe align the image to the center). Instead, when the user enables the setting "Crop image to fit", all the images will have the gallery's height and width. Does it make sense? |
I agree. That's what the toggle does – if enabled, all images will be made into squares and aligned to the center (also during crop; most images have a central focal point, so we should always crop out the edges).
Agreed. The behavior in the first video feels a bit odd, but the worst part is that it changes the position of the arrow buttons, which isn't great. I think it'd make the most sense to align the images in the center no matter their aspect ratio. |
…o fix/animation-dialog
…erce-blocks into fix/animation-dialog
@jarekmorawski Thanks for the feedback! @danieldudzic, according with the feedback, with 05a3eb6 I added the CSS to center the images. Also, I fixed an error when the zoom is disabled (18d416e) and fixed some E2E tests given that the structure of the DOM is changed with this PR (b6d0088). |
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.
Superb work, @gigitux!
Both the animation and zoom now work as expected!
Warning
This PR is blocked by #11111
Note
I created a follow-up issue to add E2E tests woocommerce/woocommerce#42192
What
Fixes #10870. Currently, there isn't any animation when the large image changes.
Why
This PR implements the animation when the user changes the large image with:
Testing Instructions
Please consider any edge cases this change may have, and also other areas of the product this may impact.
Screenshots or screencast
Screen.Capture.Oct.5.2.mp4
Screen.Capture.Oct.5.3.mp4
WooCommerce Visibility
Required:
Checklist
Required:
[type]
label or a[skip-changelog]
label.Conditional:
[skip-changelog]
label is not present).Changelog