banthagroup / fslightbox-react

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

Uncaught TypeError: Cannot read property 'offsetWidth' of null #193

Open brontesflorals opened 3 years ago

brontesflorals commented 3 years ago

I've implemented this on a website using NextJs. When opening, navigating, and closing the lightbox, I get the following error in my console multiple times: Uncaught TypeError: Cannot read property 'offsetWidth' of null.

It also seems to have pretty poor performance (slow to open, slow to close, slow to restore scroll bar).

Any ideas why this is happening?

Thanks!

qlereboursBS commented 2 years ago

@piotrzdziarski any news on this? I have a pro version and implemented the onSlideChange event, but as soon as implemented, I have Cannot read property 'offsetWidth' of null when switching from one slide to another. image

image

qlereboursBS commented 2 years ago

edit: I think there's nothing to do with the onSlideChange event, it's just that I'm changing a state in my component, which re-renders the component and triggers the error

PabloChanivet commented 3 months ago

Hi, I'm using pro version and I'm facing the same problem. Any hints on it?

PabloChanivet commented 3 months ago

The error seems to be in the source array, now I was able to solved it