banthagroup / fslightbox-react

Basic version of Fullscreen Lightbox for React.js. Website: https://fslightbox.com/react
MIT License
169 stars 23 forks source link

Incorrect image loads after navigating through lightbox view #166

Closed JeffMusgrave closed 3 years ago

JeffMusgrave commented 4 years ago

This is specific to the react version and occurs on the demo on the fslightbox website as well.

To reproduce:

The image that loads this time will be the last image displayed in the lightbox. So, if you closed the lightbox on image 5, when clicking thumbnail 1, it will open the lightbox and show image 5 instead of image 1.

You can effectively reset this behaviour by clicking on another thumbnail at any point, then clicking the first thumbnail, which will result in the correct image being displayed in the lightbox.

piotrzdziarski commented 3 years ago

Workaround: reset slide state in onClose event listener, for example set it to null.

piotrzdziarski commented 3 years ago

Fixed in 1.6.1