Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

SD-741 Fix PDP thumbnails carousel scrolling behaviour

Krzysztof Kalisz3a26476429e7
diff --git a/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss b/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss
index 059bca3d6a..29fd2b7b92 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/components-bootstrap/carousel.scss
@@ -15,6 +15,10 @@
}
&-vertically-animated {
// Source: https://stackoverflow.com/questions/42910076/bootstrap-4-alpha-6-vertical-carousel
+ .carousel-item {
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+ }
.carousel-item-next.carousel-item-left,
.carousel-item-prev.carousel-item-right {
-webkit-transform: translate3d(0, 0, 0);
diff --git a/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss b/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss
index 57bddd5425..49d2008f41 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/views/spree/shared/carousel/thumbnails.scss
@@ -1,5 +1,6 @@
.product-thumbnails-carousel {
&-item {
+ will-change: transform;
$single-gap: 5%;
&-content {
height: 0;
diff --git a/frontend/app/views/spree/shared/carousel/_thumbnails.html.erb b/frontend/app/views/spree/shared/carousel/_thumbnails.html.erb
index 2f83866041..5fb317a94c 100644
--- a/frontend/app/views/spree/shared/carousel/_thumbnails.html.erb
+++ b/frontend/app/views/spree/shared/carousel/_thumbnails.html.erb
@@ -11,9 +11,9 @@
<div class="carousel-inner order-1 h-100">
<% images.each_with_index do |image, image_index| %>
<% if image_index % per_page == 0 %>
- <div class="carousel-item product-thumbnails-carousel-item<%= ' active' if image_index == 0 %>">
+ <div class="carousel-item product-thumbnails-carousel-item h-100<%= ' active' if image_index == 0 %>">
<div class="h-100 d-flex flex-column justify-content-center">
- <div class="product-thumbnails-carousel-item-content py-1">
+ <div class="product-thumbnails-carousel-item-content py-1 h-100">
<% end %>
<div
class="product-thumbnails-carousel-item-single product-thumbnails-carousel-item-single--visible"