loktar00 / react-lazy-load

React component that renders children elements when they enter the viewport.
MIT License
979 stars 166 forks source link

Doesn't work well inside an iframe or an element with overflow #130

Open dizel3d opened 6 years ago

dizel3d commented 6 years ago

Doesn't work well:

  1. inside an iframe that isn't visible in top window viewport.
  2. inside an element with overflow, e.g. inside div { width: 0; height: 0; overflow: hidden; }.

In the cases above LazyLoad shouldn't trigger loading, but it does.

Using IntersectionObserver would be a solution.

dizel3d commented 6 years ago

One more advice about IntersectionObserver https://github.com/loktar00/react-lazy-load/issues/123