Browse Source

Fix IntersectionObserver isIntersecting in Edge (#3365)

closed-social-v3
Nolan Lawson 7 years ago
committed by Eugen Rochko
parent
commit
24d645b7d0
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      app/javascript/mastodon/components/status_list.js

+ 3
- 1
app/javascript/mastodon/components/status_list.js View File

@ -70,7 +70,9 @@ class StatusList extends ImmutablePureComponent {
entries.forEach(entry => { entries.forEach(entry => {
const statusId = entry.target.getAttribute('data-id'); const statusId = entry.target.getAttribute('data-id');
state.isIntersecting[statusId] = entry.isIntersecting;
// Edge 15 doesn't support isIntersecting, but we can infer it from intersectionRatio
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12156111/
state.isIntersecting[statusId] = entry.intersectionRatio > 0;
}); });
// isIntersecting is a map of DOM data-id's to booleans (true for // isIntersecting is a map of DOM data-id's to booleans (true for

Loading…
Cancel
Save