Skip to content

Commit

Permalink
fix: computation of slides per view when swiper is full width
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-hv committed Apr 18, 2024
1 parent 81ec13a commit 11c29ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/Swiper/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export const useSwiper = (options: UseSwiperProps = {}) => {
return slidesPerView.mobile
} else if (viewportWidth <= screens.lg) {
return slidesPerView.tablet
} else {
} else if (viewportWidth <= screens['4xl']) {
return slidesPerView.desktop
} else {
return slidesPerView.desktop + 2
}
}, [slidesPerView, screens.md, screens.lg, viewportWidth])
}, [viewportWidth, screens, slidesPerView])

return {
centeredSlides,
Expand Down
2 changes: 1 addition & 1 deletion packages/Swiper/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const Container = styled.ul<Pick<UseSwiper, 'slidesPerView' | 'spaceBetwe
`}
}
@media (min-width: 1920px) {
@media (min-width: 4xl) {
${desktop &&
fullWidth &&
css`
Expand Down

0 comments on commit 11c29ec

Please sign in to comment.