提交 275d2a02 编写于 作者: J Joao Moreno

fixes #64749

上级 c7487345
......@@ -431,6 +431,16 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
return scrollDimensions.height;
}
get firstVisibleIndex(): number {
const range = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
return range.start;
}
get lastVisibleIndex(): number {
const range = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
return range.end - 1;
}
element(index: number): T {
return this.items[index].element;
}
......
......@@ -1308,6 +1308,14 @@ export class List<T> implements ISpliceable<T>, IDisposable {
return this.view.renderHeight;
}
get firstVisibleIndex(): number {
return this.view.firstVisibleIndex;
}
get lastVisibleIndex(): number {
return this.view.lastVisibleIndex;
}
domFocus(): void {
this.view.domNode.focus();
}
......
......@@ -1090,6 +1090,18 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
return this.view.renderHeight;
}
get firstVisibleElement(): T {
const index = this.view.firstVisibleIndex;
const node = this.view.element(index);
return node.element;
}
get lastVisibleElement(): T {
const index = this.view.lastVisibleIndex;
const node = this.view.element(index);
return node.element;
}
domFocus(): void {
this.view.domFocus();
}
......
......@@ -372,6 +372,14 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable
return this.tree.renderHeight;
}
get firstVisibleElement(): T {
return this.tree.firstVisibleElement!.element as T;
}
get lastVisibleElement(): T {
return this.tree.lastVisibleElement!.element as T;
}
domFocus(): void {
this.tree.domFocus();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册