mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-03 02:35:52 +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 { keyToString } = this.props;
|
||||
|
||||
let bottomIndex = visibleItems[visibleItems.length - 1];
|
||||
const { scrollTop, scrollHeight } = this.window;
|
||||
const topSpacing = this.props.origin === 'top' ? scrollTop : scrollHeight - scrollTop;
|
||||
const items = this.props.origin === 'top' ? visibleItems : [...visibleItems].reverse();
|
||||
let bottomIndex = items[0];
|
||||
items.forEach((index) => {
|
||||
const el = this.childRefs.get(keyToString(index));
|
||||
if(!el) {
|
||||
|
Loading…
Reference in New Issue
Block a user