Closed W1zzardTPU closed 5 years ago
My guess is that the scroll position of the slider viewport remains the same. You could use selectCell
after append the elements and select the current length - 1 (because is zero-based).
...
var cellElems = [ makeCell(), makeCell() ];
flkty.append( cellElems);
flkty.selectCell( flkty.cells.length - 1 ); //Add this
...
Thanks for reporting this issue.
The issue is that is that contain
makes it hard for Flickity to decide which cell is selected when you're at the end. So when you append new cells, it selects the closest one. Thus it shifts a bit. So one way to resolve this is to disable contain
.
I feel this is an edge case. I appreciate you reporting the problem, but I'd like to focus my attention elsewhere.
When the carousel is scrolled all the way to the end and items are appended, the whole carousel shifts. Is this intentional? Any way to disable this behavior?
https://codepen.io/anon/pen/xBeWVy