Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centerInsufficientSlides doesn't count slidesOffsetBefore/slidesOffsetAfter params #5436

Closed
5 of 6 tasks
vsavaryn-lohika opened this issue Feb 8, 2022 · 7 comments · May be fixed by #7437
Closed
5 of 6 tasks

centerInsufficientSlides doesn't count slidesOffsetBefore/slidesOffsetAfter params #5436

vsavaryn-lohika opened this issue Feb 8, 2022 · 7 comments · May be fixed by #7437

Comments

@vsavaryn-lohika
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

see attached screenshot from file updateSlides.js

Bug description

centerInsufficientSlides doesn't count slidesOffsetBefore/slidesOffsetAfter params
As a result slides NOT CENTERED correctly.
When I remove slidesOffset params - it centers correctly.

image

Please fix it.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

8.0.3

Platform/Target and Browser Versions

all

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@Hanskrogh
Copy link

Would love for this to be implemented!

@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 21, 2023
@lennartdeknikker
Copy link

I'm bumping into this issue as well. I think this could be solved by not applying the slidesOffsetBefore & slidesOffsetAfter when the centerInsufficientSlides gets triggered or better yet by subtracting the offset from the x value in the translate3D function.

@stale stale bot removed the stale label May 31, 2023
@mbcod3
Copy link

mbcod3 commented Jun 28, 2023

I am facing same problem even with equal offset before and after it doesnt center correctly.

In the end what I did was add left padding in first .swiper-slide and right padding to last .swiper-slide div.

@ovelilla
Copy link

ovelilla commented Aug 9, 2023

I have the same problem

@benwallis
Copy link

When using any SlidesOffset the wrapper gets position wrong (translate3D xpos is double/triple what it should be)

@nolimits4web
Copy link
Owner

Issue is closed because of outdated/irrelevant/not actual/needed more information/inactivity.

If this issue is still actual and reproducible for latest version of Swiper, please create new issue and fill the issue template correctly:

  • Clearly describe the issue including steps to reproduce when it is a bug.
  • Make sure you fill in the earliest version that you know has the issue.
  • Provide live link or JSFiddle/Codepen or website with issue

Repository owner locked and limited conversation to collaborators Oct 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants