mWater / mwater-visualization

GNU Lesser General Public License v3.0
3 stars 5 forks source link

react-lazyload crash #447

Closed grassick closed 4 years ago

grassick commented 4 years ago

Inside react-lazyload:

     if (scroll) {
          (0, _event.on)(scrollport, 'scroll', finalLazyLoadHandler, passiveEvent);
        }

scrollport is null, which leads to a crash of https://api.mwater.co/v3/admin/problem_reports/90008

This is fully reproducible logging in as "Krua" and going to https://portal.mwater.co/#/forms/6c62b0a73eaf442c8d777dd987cf64e3/visualization and scrolling down.

The issue hasn't been reported by anyone to react-lazyload.

grassick commented 4 years ago

Aha: is because react-lazyload is set up to assume that the widget will be inside .mwater-visualization-block-parent-outer

This isn't the case for dashboard widgets that are used in survey visualizations. Also, not the case for dashboard widgets used in UI-builder. Can we make it more generic?

broncha commented 4 years ago

Hmm, I was actually reluctant to add that container, but something changed in visualization that could not track window scroll. I will try and fix it without a container

Autio commented 4 years ago

Probably linked to this https://portal.mwater.co/#/forms/d2cdad69f18243dba37ea7993a962d97/visualization errors out after a minute of loading with TypeError: el is null