You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding 2 or more modals/carousels on a page there is a conflict. Can the instances (states?) have a property where they can be assigned a unique identifier?
Expected: When clicking a thumbnail for one of two or more galleries the image the image appearing in the lightbox should be the same as the image in thumbnail.
Actual: The image which appears is from the last gallery on the page regardless of which gallery is clicked on.
I am very new to React. I would attempt to implement this but not sure where to start.
jpkelly
changed the title
Support for multiple modals/galleries on a page
[Feature request] Support for multiple modals/galleries on a page
Jun 2, 2020
I believe your issue is to do with a misuse of state.
You are using the same closeLightbox and openLightbox callbacks for each Modal, and therefore you will see when you click an image, both of the images are displayed, with the second lightbox image being on top of the image selected from the first lightbox. The images that displayed have the same ID in their respective lightbox, since we are using the same state.
When adding 2 or more modals/carousels on a page there is a conflict. Can the instances (states?) have a property where they can be assigned a unique identifier?
Expected: When clicking a thumbnail for one of two or more galleries the image the image appearing in the lightbox should be the same as the image in thumbnail.
Actual: The image which appears is from the last gallery on the page regardless of which gallery is clicked on.
Example:
https://codesandbox.io/s/react-photo-gallery-with-image-viewer-gcsq8
The text was updated successfully, but these errors were encountered: