metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.53k stars 602 forks source link

Upon sliding, Flickity selects random cell when "contain=true" #854

Closed chessydk closed 5 years ago

chessydk commented 6 years ago

https://codepen.io/chessydk/pen/BqGEod

Try sliding in either direction a couple of times. When sliding stops, a random cell is selected. It could be the middle, the one to outermost left or to the outermost right.

When contain=false it works according to cellAlign.

desandro commented 6 years ago

Thanks for reporting this issue. Flickity is behaving as expected. Although, it's a bit quirky with contain enabled:

chessydk commented 6 years ago

Its hard to argue against "behaving as expected", but may I ask why you made the select strategy work differently with contain enabled ? I can't come up with any good reason for that. To me and our users it looks like random selection and makes this mode useless which is a shame because I like what its doing (beside of the slide/selection strategy)

desandro commented 6 years ago

Because the contain behavior requires this kind of selection. It works this way because that's how containment works. Sorry for the tautological argument. But, in other words, it works this way because its the most straightforward method that works with Flickity's underlying API.