mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 13:54:20 +03:00
VirtualScroller: prevent reflow loop when origin=top
This commit is contained in:
parent
517e4c726c
commit
0653685f26
@ -498,10 +498,10 @@ export default class VirtualScroller<K,V> extends Component<VirtualScrollerProps
|
|||||||
const { visibleItems } = this.state;
|
const { visibleItems } = this.state;
|
||||||
const { keyToString } = this.props;
|
const { keyToString } = this.props;
|
||||||
|
|
||||||
let bottomIndex = visibleItems[visibleItems.length - 1];
|
|
||||||
const { scrollTop, scrollHeight } = this.window;
|
const { scrollTop, scrollHeight } = this.window;
|
||||||
const topSpacing = this.props.origin === 'top' ? scrollTop : scrollHeight - scrollTop;
|
const topSpacing = this.props.origin === 'top' ? scrollTop : scrollHeight - scrollTop;
|
||||||
const items = this.props.origin === 'top' ? visibleItems : [...visibleItems].reverse();
|
const items = this.props.origin === 'top' ? visibleItems : [...visibleItems].reverse();
|
||||||
|
let bottomIndex = items[0];
|
||||||
items.forEach((index) => {
|
items.forEach((index) => {
|
||||||
const el = this.childRefs.get(keyToString(index));
|
const el = this.childRefs.get(keyToString(index));
|
||||||
if(!el) {
|
if(!el) {
|
||||||
|
Loading…
Reference in New Issue
Block a user