mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
fix #119728.
This commit is contained in:
@@ -65,6 +65,7 @@ export class CellEditorStatusBar extends Disposable {
|
||||
) {
|
||||
super();
|
||||
this.statusBarContainer = DOM.append(container, $('.cell-statusbar-container'));
|
||||
this.statusBarContainer.tabIndex = -1;
|
||||
const leftItemsContainer = DOM.append(this.statusBarContainer, $('.cell-status-left'));
|
||||
const rightItemsContainer = DOM.append(this.statusBarContainer, $('.cell-status-right'));
|
||||
this.cellRunStatusContainer = DOM.append(leftItemsContainer, $('.cell-run-status'));
|
||||
|
||||
@@ -204,7 +204,13 @@ export class CodeCell extends Disposable {
|
||||
}));
|
||||
|
||||
// Focus Mode
|
||||
const updateFocusMode = () => viewCell.focusMode = templateData.editor.hasWidgetFocus() ? CellFocusMode.Editor : CellFocusMode.Container;
|
||||
const updateFocusMode = () => {
|
||||
viewCell.focusMode =
|
||||
(templateData.editor.hasWidgetFocus() || (document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement)))
|
||||
? CellFocusMode.Editor
|
||||
: CellFocusMode.Container;
|
||||
};
|
||||
|
||||
this._register(templateData.editor.onDidFocusEditorWidget(() => {
|
||||
updateFocusMode();
|
||||
}));
|
||||
@@ -212,7 +218,7 @@ export class CodeCell extends Disposable {
|
||||
// this is for a special case:
|
||||
// users click the status bar empty space, which we will then focus the editor
|
||||
// so we don't want to update the focus state too eagerly
|
||||
if (document.activeElement?.contains(this.templateData.container)) {
|
||||
if (document.activeElement && this.templateData.statusBar.statusBarContainer.contains(document.activeElement)) {
|
||||
setTimeout(() => {
|
||||
updateFocusMode();
|
||||
}, 300);
|
||||
|
||||
Reference in New Issue
Block a user