Skip to content
Snippets Groups Projects
Commit 3363f2f4 authored by Nolan Lawson's avatar Nolan Lawson Committed by Eugen Rochko
Browse files

Fix isIntersecting in Chrome (#3525)

parent c7f2d6af
No related branches found
No related tags found
No related merge requests found
......@@ -88,9 +88,11 @@ class Status extends ImmutablePureComponent {
}
handleIntersection = (entry) => {
// Edge 15 doesn't support isIntersecting, but we can infer it from intersectionRatio
// Edge 15 doesn't support isIntersecting, but we can infer it
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12156111/
const isIntersecting = entry.intersectionRatio > 0;
// https://github.com/WICG/IntersectionObserver/issues/211
const isIntersecting = (typeof entry.isIntersecting === 'boolean') ?
entry.isIntersecting : entry.intersectionRect.height > 0;
this.setState((prevState) => {
if (prevState.isIntersecting && !isIntersecting) {
scheduleIdleTask(this.hideIfNotIntersecting);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment