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

Property disableArrowsOnEdges not disabling right arrow if number of slides not a multiple of visibleSlides #165

Open
xss opened this issue Jan 12, 2022 · 5 comments

Comments

@xss
Copy link

xss commented Jan 12, 2022

Given I have 13 slides in total, and I have visibleSlides set to 5 and slideMultiple to true in order to display and scroll 5 slides per navigation step, I would expect the "next" (right) arrow to be hidden on the third step (last 3 slides visible) when disableArrowsOnEdges is set to true. However, the right arrow remains even in the last possible navigation step, even though clicking seems to have no effect.

In contrast, the left arrow disappears on the first step, as would be expected. Also, should the slider have, for example, 10 or 15 slides (or some other multiple of the desired 5 slides per step), the right arrow disappears correctly.

This is an issue for me as I use Vueper Slides in a context where multiple sliders get created with a dynamic number of content slides, so multiples of somefixed value will not work, and are also rather pointless for responsive layouts when in smaller breakpoints visibleSlides differ.

Am I missing something here, or can this issue be confirmed by others?

@Woolgar
Copy link

Woolgar commented Mar 14, 2023

Experiencing same issue, did you find a solution to this problem?

@xss
Copy link
Author

xss commented Mar 16, 2023

Hi. Unfortunately, we did not find a solution at the time, no. I believe we reduced the step size per click to 1 in order to obscure this (for us) unacceptable design/consitency bug – which may cause a frustrating lot of clicking for the user.

In the end, we resorted to switching to another slider/carousel.

@yoshrubin
Copy link

this is super annoying, what slider did you end up using?

@xss
Copy link
Author

xss commented Nov 20, 2023

I hope it is acceptable to mention and link to another project here... We are using vue3-carousel now. Perhaps not perfect, either, but suits our use case better, especially in respect to this issue.

@yoshrubin
Copy link

Ok I found a workaround for this issue,

I have a conditional class last-slide on the <VueperSlides> element
the class: (tailwind)

  .last-slide button.vueperslides__arrow.vueperslides__arrow--next {
    @apply opacity-0 cursor-default pointer-events-none;
  }

I then added an event handler for before-slide

 onBeforeSlide(event) {
     const { currentSlide, nextSlide } = event
     const indexDiff = nextSlide.index - currentSlide.index
     if (indexDiff > 0) {
       this.currentPage += 1
     } else if (indexDiff < 0) {
       this.currentPage -= 1
     }
   }

the computed value I used to determine the conditional class is

  isLastSlide() {
     return this.currentPage >= this.courses.length / this.itemsPerPage
   },

happy to hear any feedback but this seems to get me the desired result

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

No branches or pull requests

3 participants