提交 a74af7fe 编写于 作者: J Joao Moreno

list: fix scroll height issue

上级 cab46acc
......@@ -65,6 +65,7 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
private gesture: Gesture;
private rowsContainer: HTMLElement;
private scrollableElement: ScrollableElement;
private scrollHeight: number;
private didRequestScrollableElementUpdate: boolean = false;
private splicing = false;
private dragAndDropScrollInterval: number;
......@@ -198,12 +199,13 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
}
}
const scrollHeight = this.getContentHeight();
this.rowsContainer.style.height = `${scrollHeight}px`;
this.scrollHeight = this.getContentHeight();
this.rowsContainer.style.height = `${this.scrollHeight}px`;
if (!this.didRequestScrollableElementUpdate) {
DOM.scheduleAtNextAnimationFrame(() => {
this.scrollableElement.setScrollDimensions({ scrollHeight });
console.log(this.scrollHeight);
this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight });
this.didRequestScrollableElementUpdate = false;
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册