Height cache stick to reduce jitteryness, fixes #117
This commit is contained in:
parent
6f0c9840be
commit
fabb300caf
1 changed files with 8 additions and 1 deletions
|
@ -120,7 +120,14 @@ export default class IntersectionObserverArticle extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article ref={this.handleRef} aria-posinset={index + 1} aria-setsize={listLength} data-id={id} tabIndex='0'>
|
<article
|
||||||
|
ref={this.handleRef}
|
||||||
|
aria-posinset={index + 1}
|
||||||
|
aria-setsize={listLength}
|
||||||
|
style={{ height: cachedHeight ? `${cachedHeight}px` : null }}
|
||||||
|
data-id={id}
|
||||||
|
tabIndex='0'
|
||||||
|
>
|
||||||
{children && React.cloneElement(children, { hidden: false })}
|
{children && React.cloneElement(children, { hidden: false })}
|
||||||
</article>
|
</article>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue