]> cat aescling's git repositories - mastodon.git/commitdiff
Fix IntersectionObserver isIntersecting in Edge (#3365)
authorNolan Lawson <nolan@nolanlawson.com>
Sun, 28 May 2017 14:45:42 +0000 (07:45 -0700)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 28 May 2017 14:45:42 +0000 (16:45 +0200)
app/javascript/mastodon/components/status_list.js

index 59089ad9258fe33e3da17301a93a454258cbf1de..39f663dfb367960c1672a783dfb164ead22674e0 100644 (file)
@@ -70,7 +70,9 @@ class StatusList extends ImmutablePureComponent {
         entries.forEach(entry => {
           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