vue3-infinite-loading icon indicating copy to clipboard operation
vue3-infinite-loading copied to clipboard

Cannot read properties of null (reading 'getBoundingClientRect')

Open leekung opened this issue 2 years ago • 3 comments

I got this error on production build website Sentry stack trace show me that the error is from this package

Screenshot 2023-08-31 at 22 23 48

I don't know why element is null, maybe we have to check

function isVisible(el: Element, view: Element | null): boolean {
  if (!el) return false; //<-- maybe we add this to prevent error
  const elRect = el.getBoundingClientRect();
  if (!view) return elRect.top >= 0 && elRect.bottom <= window.innerHeight;
  const viewRect = view.getBoundingClientRect();
  return elRect.top >= viewRect.top && elRect.bottom <= viewRect.bottom;
}

leekung avatar Aug 31 '23 15:08 leekung

I have the same issue

SpiritusDeos avatar Sep 07 '23 14:09 SpiritusDeos

I have the same issue

Oliwer-Budnik avatar Oct 12 '23 10:10 Oliwer-Budnik

I have the same issue

fiamma06 avatar Oct 16 '23 09:10 fiamma06