Fix error when focusing notebook as it's loading

Can't call getCellIndex of undefined
This commit is contained in:
Rob Lourens 2020-06-17 12:45:03 -05:00
parent 034d893cd5
commit 451ec4d8b6

View file

@ -529,7 +529,7 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
// override
domFocus() {
const focused = this.getFocusedElements()[0];
const focusedDomElement = this.domElementOfElement(focused);
const focusedDomElement = focused && this.domElementOfElement(focused);
if (document.activeElement && focusedDomElement && focusedDomElement.contains(document.activeElement)) {
// for example, when focus goes into monaco editor, if we refocus the list view, the editor will lose focus.