Height cache stick to reduce jitteryness, fixes #117

This commit is contained in:
Alex Gleason 2020-05-26 20:39:55 -05:00
parent 6f0c9840be
commit fabb300caf
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -120,7 +120,14 @@ export default class IntersectionObserverArticle extends React.Component {
}
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 })}
</article>
);