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

list: fix scroll height issue

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