mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(img): use setTimeout fallback on older versions of chrome (#21358)
This commit is contained in:
@ -53,7 +53,11 @@ export class Img implements ComponentInterface {
|
|||||||
if (this.src === undefined) {
|
if (this.src === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ('IntersectionObserver' in window) {
|
if (
|
||||||
|
typeof (window as any) !== 'undefined' &&
|
||||||
|
'IntersectionObserver' in window &&
|
||||||
|
'IntersectionObserverEntry' in window &&
|
||||||
|
'isIntersecting' in window.IntersectionObserverEntry.prototype) {
|
||||||
this.removeIO();
|
this.removeIO();
|
||||||
this.io = new IntersectionObserver(data => {
|
this.io = new IntersectionObserver(data => {
|
||||||
// because there will only ever be one instance
|
// because there will only ever be one instance
|
||||||
|
|||||||
Reference in New Issue
Block a user