提交 0a022904 编写于 作者: R Rob Lourens

Fix up document focus when moving cell focus

上级 36595f92
......@@ -66,9 +66,15 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
});
this._previousFocusedElements = e.elements;
// Force focus out of webview if focus is in webview and I press an arrow key to focus the next cell
if (document.activeElement && document.activeElement.tagName.toLowerCase() === 'webview') {
this.focusView();
// if focus is in the list, but is not inside the focused element, then reset focus
if (DOM.isAncestor(document.activeElement, this.rowsContainer)) {
const focusedElement = this.getFocusedElements()[0];
if (focusedElement) {
const focusedDomElement = this.domElementOfElement(focusedElement);
if (focusedDomElement && !DOM.isAncestor(document.activeElement, focusedDomElement)) {
focusedDomElement.focus();
}
}
}
}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册