mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-27 22:23:43 +01:00
Hide items rendered out-of-frame (once they have been rendered at least once)
This commit is contained in:
parent
1a70fca168
commit
405ef5ad37
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStateAfterIntersection = (prevState) => {
|
updateStateAfterIntersection = (prevState) => {
|
||||||
if (prevState.isIntersecting && !this.entry.isIntersecting) {
|
if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
|
||||||
scheduleIdleTask(this.hideIfNotIntersecting);
|
scheduleIdleTask(this.hideIfNotIntersecting);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
|
@ -109,7 +109,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent
|
||||||
ref={this.handleRef}
|
ref={this.handleRef}
|
||||||
aria-posinset={index + 1}
|
aria-posinset={index + 1}
|
||||||
aria-setsize={listLength}
|
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}
|
data-id={id}
|
||||||
tabIndex='0'
|
tabIndex='0'
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue