keen-slider icon indicating copy to clipboard operation
keen-slider copied to clipboard

slider.update() doesn't position new element if children length stays the same

Open timfuhrmann opened this issue 2 years ago • 1 comments

Adding new elements and calling update() properly positions the new slide/element. But replacing an element somehow doesn't, no transformation will be applied to the new child.

After investigating I found this check, which might be the problem, since the length is not changing - calling slider.update(slider.options) works as a workaround - it this intended? https://github.com/rcbyr/keen-slider/blob/1b2f10817352b3964f262722d7311753ff2c6e38/src/plugins/web/web.ts#L140

timfuhrmann avatar Oct 10 '22 14:10 timfuhrmann

Hello @timfuhrmann

I think that could be optimized. Thanks for pointing it out.

rcbyr avatar Oct 15 '22 12:10 rcbyr