daelmaak / ngx-gallery

Homepage
https://daelmaak.github.io/ngx-gallery/
Apache License 2.0
13 stars 4 forks source link

When `items` switches from 0 to more than 1 image, the last one is shown initially, not the first one #104

Closed pappkamerad closed 6 months ago

pappkamerad commented 7 months ago

i assume, it is due to center() not being called after inputs changed (https://github.com/daelmaak/ngx-gallery/blob/master/libs/gallery/src/lib/components/viewer/viewer.component.ts#L274)

my workaround currently is to call gallery.select(0) after we updated the items but this slides the images once :(

daelmaak commented 6 months ago

Thanks. I wrote a test and created a repo to reproduce it but no success. Can you please elaborate or create a reproduction stackblitz?

daelmaak commented 6 months ago

I reproduced it in loop mode 👍