Skip to content

Extend feature detection with isIntersecting #211

Closed
@stefanjudis

Description

@stefanjudis

👋 Hello.

I discovered that according to caniuse Edge 15 supports the Intersection Observer API. While playing around with it I discovered though, that Edge does not implement the isIntersecting property.

The Firefox implementation (behind a flag currently) is also missing this property on IntersectionObserverEntry.

Would it make sense to extend the feature detection which is currently:

if ('IntersectionObserver' in window &&
    'IntersectionObserverEntry' in window &&
    'intersectionRatio' in window.IntersectionObserverEntry.prototype) {
  return;
}

with a check for this property? I think it's really handy and this property missing could lead to "unexpected behavior" on developer's side.

if ('IntersectionObserver' in window &&
    'IntersectionObserverEntry' in window &&
    'intersectionRatio' in window.IntersectionObserverEntry.prototype &&
    'isIntersecting' in window.IntersectionObserverEntry.prototype) {
  return;
}

Thanks in advance. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions