vuetify icon indicating copy to clipboard operation
vuetify copied to clipboard

[Bug Report][2.6.12] Custom control in Carousel. When in slide 0, the button back does nothing.

Open Stefanosapk opened this issue 2 years ago • 1 comments

Environment

Vuetify Version: 2.6.12 Vue Version: 2.6.11 Browsers: Chrome 106.0.0.0 OS: Mac OS 10.15.7

Steps to reproduce

Stay at slide 0 and try to go back, does nothing.

Expected Behavior

Being at 0 slide and clicking to go back I expect to go to the last slide.

Actual Behavior

Being in 0 slide, back slide keeps me in the 0 slide

Reproduction Link

https://codepen.io/lastm4n/pen/KKepPqB?editors=1111

Stefanosapk avatar Oct 27 '22 17:10 Stefanosapk

This wouldnt be something caused by Vuetify, nor something that can be fixed within Vuetify. The reason this happens is because the minus removes 1 from the model every time it gets clicked. So when it is on 0 and gets clicked, it tries to set it to -1, but gets set back to 0 by the carousel because -1 doesnt exist as an item.

Therefore I would recommend using an method to handle the click instead,

Here is an edited version of your codepen, which works. I hope you can take inspiration for it and fix this issue. https://codepen.io/Zer1o/pen/ZERWWrv?editors=1111

Z3rio avatar Nov 02 '22 13:11 Z3rio

Since Vuetify gives you the option to custom control the carousel behaviour, I think they can find a way and should solve it. Right now there is a bug in their component.

Stefanosapk avatar Nov 02 '22 20:11 Stefanosapk

No, Vuetify cannot change the functionality of Javascript mate.

They could probably fix this yeah, but it isnt really a "bug", since the real issue is it is being used incorrectly.

Z3rio avatar Nov 02 '22 20:11 Z3rio

When you move from slide 4 (counting from 0) to the next one you one up with slide 5 which does not exists as well, however slide 0 is being displayed instead. Same might be done with slide -1

jacekkarczmarczyk avatar Nov 02 '22 20:11 jacekkarczmarczyk

When you move from slide 4 (counting from 0) to the next one you one up with slide 5 which does not exists as well, however slide 0 is being displayed instead. Same might be done with slide -1

Yeah I guess I could take a look at that, but until it gets fixed, I would recommend everyone to just use the logic I linked, or something close to it.

Z3rio avatar Nov 02 '22 20:11 Z3rio

The current behaviour is from item-group's mandatory, if the model value is not a valid item it selects the first one instead.

KaelWD avatar Nov 03 '22 09:11 KaelWD