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

Swiper/React Custom navigation buttons are not properly enabled/disabled #5609

Closed
5 of 6 tasks
alicerocheman opened this issue Apr 5, 2022 · 1 comment
Closed
5 of 6 tasks
Labels

Comments

@alicerocheman
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/autumn-monad-b6o1xq?file=/src/Slider.js:3272-3280

Bug description

ON OUR APP
1a. We have a slider, whose content is changed by user click.
1b. Our slider component wraps each child in a SwiperSlide (necessary for code factorisation, since calling SwiperSlide from a child components breaks Swiper)
2. At first load (4 slides / 4 slidesPerView) the nav buttons are disabled. (works properly)
3. When the user clicks, loading turns true, child of swiper is a div with a loader, buttons are forced disabled. (works properly)
4. Once data arrives (4 slides / 4 slidesPerView), both buttons become enabled when they should both stay disabled. (bug)

ON CODESANDBOX
We tried to reproduce on codesandbox, as close to our real code as possible.
The items array is stored in a state, which is changed by user click.
At first load as well as later when data is updated, both nav buttons are enabled (bug)
issue persist even when loading behavior (with btns forced disabled) is removed (see code)

Expected Behavior

With 4 slides passed and 4 slidesPerView, both navigation buttons should be disabled

Actual Behavior

With 4 slides passed and 4 slidesPerView, both navigation buttons are enabled

Swiper version

8.0.7

Platform/Target and Browser Versions

MacOs 12.3.1 - Chrome Version 100.0.4896.60 (Official Build) (x86_64)

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
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants