Skip to content

Commit 8a86f4e

Browse files
authored
Merge pull request #227 from AthosCommerce/carousel-bugfix
fix(carousel): bugfix for backwards compatibility with carousel and u…
2 parents ca1f318 + dce818e commit 8a86f4e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

  • packages/snap-preact/components/src/components/Molecules/Carousel

packages/snap-preact/components/src/components/Molecules/Carousel/Carousel.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,13 @@ export const Carousel = observer((properties: CarouselProps) => {
205205
? JSON.parse(JSON.stringify(defaultVerticalCarouselBreakpoints))
206206
: JSON.parse(JSON.stringify(defaultCarouselBreakpoints)),
207207
pagination: false,
208-
slidesPerGroup: 5,
209-
slidesPerView: 5,
208+
slidesPerGroup: !properties.breakpoints || !Object.keys(properties.breakpoints).length ? 5 : undefined,
209+
slidesPerView: !properties.breakpoints || !Object.keys(properties.breakpoints).length ? 5 : undefined,
210210
spaceBetween: 10,
211211
loop: true,
212212
autoAdjustSlides: false,
213213
treePath: globalTreePath,
214214
};
215-
216215
let props = mergeProps('carousel', globalTheme, defaultProps, properties);
217216
let displaySettings;
218217

0 commit comments

Comments
 (0)