vue-carousel icon indicating copy to clipboard operation
vue-carousel copied to clipboard

Bug: Carousel is failing to remain locked to correct position on click

Open skyerus opened this issue 6 years ago • 8 comments

Bug Report

Current Behavior This is a GIF displaying the issue

Input Code and steps to reproduce

<carousel :perPage="3" :navigationEnabled="true" :paginationEnabled="true" id="select-packaging">
                    <slide v-for="(item, index) in items">
                        <figure class="item-preview" :class="{highlight:item.id === selected}" @click="selected = item.id">
                            {{ item.id }}
                        </figure>
                    </slide>
                </carousel>
data() {
          return {
            items: [
              {
                id: 1
              },
              {
                id: 2
              },
              {
                id: 3
              },
              {
                id: 4
              },
              {
                id: 5
              }
            ],
            selected: undefined,
          }
        },

Expected behavior/code

It works properly when there is at least n + 2 slides (n being the number per page), this is a GIF of it working properly This is the code for it working properly:

<carousel :perPage="3" :navigationEnabled="true" :paginationEnabled="true" id="select-packaging">
                    <slide v-for="(item, index) in items">
                        <figure class="item-preview" :class="{highlight:item.id === selected}" @click="selected = item.id">
                            {{ item.id }}
                        </figure>
                    </slide>
                </carousel>

Environment

  • Found the issue on Windows 10 Chrome & IE11 & Edge
  • Works as expected on Ubuntu 18.04 Chrome

skyerus avatar Apr 05 '19 14:04 skyerus

Hey @skyerus, thanks for the detailed bug report. I definitely have not seen this behaviour before, but can take a look into it! I'll flag as a bug and see if we can get any contributor assistance in the mean time

quinnlangille avatar Apr 15 '19 21:04 quinnlangille

How to do "at least n + 2 slides (n being the number per page)" ?

lfk29m avatar Apr 29 '19 05:04 lfk29m

@lfk29m this means that if there is 3 slides per page and 5 slides total then it works. If there is 3 slides per page and 4 slides total then it won't work

skyerus avatar Apr 29 '19 15:04 skyerus

@skyerus thank u. I encountered the same problem ==

lfk29m avatar Apr 30 '19 06:04 lfk29m

+1 Vue-carousel v0.11.0 Environement : Ubuntu 19.04 Tested on Firefox 67 and Chromium 79

Edit: just tested with v0.18.0 and the bug remains

Edit 2 : The problem seems to be related with the :mouse-drag prop that was set to true. When the property is set to false, the problem disapear.

SamuelRiversMoore avatar May 14 '19 09:05 SamuelRiversMoore

Still running into the same Issue, any Updates on this ?

Subwaytime avatar Aug 26 '19 09:08 Subwaytime

I'm getting the same issue, does anybody have any update on this?

andrewsmith1996 avatar Aug 27 '19 07:08 andrewsmith1996

The same here, getting the same issue:

  • The items I'm using are buttons and onClick, the carousel rolls back to initial position.

Setting the scrollPerPage="false" solved it although I do find much better to be able to have it enabled, since I think it's better for UX since then the user can discover in less clicks all the items in the carousel.

Great component by the way 🤙

carolirod avatar Jul 10 '20 09:07 carolirod