about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-02-06 18:59:28 +0100
committerThibG <thib@sitedethib.com>2019-02-10 22:54:25 +0100
commit405ef5ad3763ebf948dff61fff8af59a3937a9f9 (patch)
tree8aec49d46d0c99fc8f76018f4c293a7e122fd367 /app/javascript
parent1a70fca168bec82e3521c2039bbdecc256f328af (diff)
Hide items rendered out-of-frame (once they have been rendered at least once)
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/components/intersection_observer_article.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.js b/app/javascript/flavours/glitch/components/intersection_observer_article.js
index 6eeca5598..03d8f17c6 100644
--- a/app/javascript/flavours/glitch/components/intersection_observer_article.js
+++ b/app/javascript/flavours/glitch/components/intersection_observer_article.js
@@ -63,7 +63,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
   }
 
   updateStateAfterIntersection = (prevState) => {
-    if (prevState.isIntersecting && !this.entry.isIntersecting) {
+    if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
       scheduleIdleTask(this.hideIfNotIntersecting);
     }
     return {
@@ -109,7 +109,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
           ref={this.handleRef}
           aria-posinset={index + 1}
           aria-setsize={listLength}
-          style={{ height: `${this.height || cachedHeight}px`, opacity: 0, overflow: 'hidden' }}
+          style={{ height: `${this.height || cachedHeight || 150}px`, opacity: 0, overflow: 'hidden' }}
           data-id={id}
           tabIndex='0'
         >