]> cat aescling's git repositories - mastodon.git/commitdiff
Fix IntersectionObserverArticle not hiding some out-of-view items (#9982)
authorThibG <thib@sitedethib.com>
Wed, 6 Feb 2019 22:36:43 +0000 (23:36 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 6 Feb 2019 22:36:43 +0000 (23:36 +0100)
IntersectionObserverArticle is made to save on RAM by avoiding fully rendering
items that are far out of view. However, it did not work for items spawned
outside the intersection observer.

app/javascript/mastodon/components/intersection_observer_article.js

index de2203a4bc4c6975bf5f29d4ad5a8ecb118c3e4a..e453730ba4fccd4ac4034e6c4addc9171736d929 100644 (file)
@@ -65,7 +65,7 @@ export default class IntersectionObserverArticle extends React.Component {
   }
 
   updateStateAfterIntersection = (prevState) => {
-    if (prevState.isIntersecting && !this.entry.isIntersecting) {
+    if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
       scheduleIdleTask(this.hideIfNotIntersecting);
     }
     return {