Open jorrit opened 1 year ago
You mean it just completely ignores the aspect of lazy loading and just displays the image fully?
Kind of on the fence... we're talking about 5% of users worldwide at most and for IE11 I'm assuming which went end of life almost exactly a year ago now.
https://caniuse.com/intersectionobserver
It really depends honestly how much it might change the component code since right now it's pretty slim overall.
The error was generated by an obsolete iPad device.
My idea was to add this to the top:
const intersectionNotSupported = typeof window !== 'undefined' && !('IntersectionObserver' in window);
set state.visible to true in the constructor if intersectionNotSupported
is true.
Return early in componentDidMount()
if componentDidMount
is true.
I just received an error report that IntersectionObserver wasn't available even on Safari 15. It seems it's marked as an 'experimental ' feature that could be disabled by the user.
Oh Safari...
Honestly I really think a polyfill would be appropriate, safari 15 is dropping out pretty fast vs 16. Just feels like a step backwards. From my former days my rule was 5% or less and I'd drop support this was for IE6-11 Safari 15 seems to be very much below that threshold fortunately.
I sometimes get error reports from old browsers that lack
IntersectionObserver
. I don't want to ship a polyfill for the small group of users that use these old browsers, I prefer to just show the lazy-loaded content instead.Would you accept a PR or make the change yourself that makes lazy loaded content visible when
IntersectionObserver
is not available?