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

initialSlide and nextEl navigation #56

Open
artnova-david opened this issue Jan 19, 2021 · 2 comments
Open

initialSlide and nextEl navigation #56

artnova-david opened this issue Jan 19, 2021 · 2 comments
Labels
bug Something isn't working PR-welcome

Comments

@artnova-david
Copy link

Describe the bug
When passing an index to 'initialSlide' and the index is the last item in the array the 'nextEl' button is not automatically disabled, but it gets disabled after clicking on it.

Expected behavior
When initializing Swiper with initialSlide as last index in the array automatically disable the 'nextEl' button.

Information

  • Tiny-Swiper Version: [e.g. v2.0.1]
  • OS: [e.g. Windows]
  • Browser: [e.g. FireFox Developer 85.0b9]
@joe223 joe223 added the bug Something isn't working label Jan 20, 2021
@joe223
Copy link
Owner

joe223 commented Jan 20, 2021

Hi @artnova-david, problem occurred while after-slide event triggered.

Sliders will slide to initialSlide after DOM rendered on initialization process. Here is the code show below

renderer.init()
sensor.attach()
slideTo(
options.initialSlide,
0
)

We should update Button state after slide action just like

instance.on('before-slide', (currentIndex: number, state: never, newIndex: number) => {
if (!instance.options.loop) {
checkNavBtnDisabledClass(newIndex)
}
})

Would you like to create a fix PR 😁 ?

@a-kud
Copy link

a-kud commented Sep 13, 2023

@joe223 is the help still required here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR-welcome
Projects
None yet
Development

No branches or pull requests

3 participants