Steps to Reproduce
- open an image modal with lightbox:
const [showLightbox, setShowLightbox] = useState(true);
const handleCloseLightbox = () => {
setTimeout(() => {
setShowLightbox(false);
if (setIsLightboxVisible) setIsLightboxVisible(false);
}, 50);
};
{showLightbox && (
<Lightbox
smallSrcSet={smallImgSrc}
medium={mediumImgSrc}
large={largeImgSrc}
alt={'Caption'}
showRotate={true}
onClose={handleCloseLightbox}
/>
)}
- Click on
zoom button

- Click on any dimmed area to close the modal keeping the image zoomed

- The error will be triggered


Expected Behavior
Lightbox should close without triggering errors, as it does when closed by pressing ESC or by clicking the close (x) button.
Version