// for example, when focus goes into monaco editor, if we refocus the list view, the editor will lose focus.
// for example, when focus goes into monaco editor, if we refocus the list view, the editor will lose focus.
return;
return;
...
@@ -79,10 +78,70 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> {
...
@@ -79,10 +78,70 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> {
super.domFocus();
super.domFocus();
}
}
// TODO@rebornix TEST & Fix potential bugs
// List items have real dynamic heights, which means after we set `scrollTop` based on the `elementTop(index)`, the element at `index` might still be removed from the view once all relayouting tasks are done.
// For example, we scroll item 10 into the view upwards, in the first round, items 7, 8, 9, 10 are all in the viewport. Then item 7 and 8 resize themselves to be larger and finally item 10 is removed from the view.
// To ensure that item 10 is always there, we need to scroll item 10 to the top edge of the viewport.