Skip to content

Commit d898904

Browse files
ClearlyClairehiyuki2578
authored andcommitted
Fix IntersectionObserverArticle not hiding some out-of-view items (mastodon#9982)
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.
1 parent f0ee884 commit d898904

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/javascript/mastodon/components/intersection_observer_article.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class IntersectionObserverArticle extends React.Component {
6565
}
6666

6767
updateStateAfterIntersection = (prevState) => {
68-
if (prevState.isIntersecting && !this.entry.isIntersecting) {
68+
if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
6969
scheduleIdleTask(this.hideIfNotIntersecting);
7070
}
7171
return {

0 commit comments

Comments
 (0)