Fix title bar focus command when hidden (#236635)

fix #236597
pull/236640/head
Benjamin Christopher Simmonds 2024-12-19 21:01:41 +01:00 committed by GitHub
parent 2a99d43315
commit 2217f51cf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -54,6 +54,7 @@ import { IBaseActionViewItemOptions } from '../../../../base/browser/ui/actionba
import { IHoverDelegate } from '../../../../base/browser/ui/hover/hoverDelegate.js';
import { CommandsRegistry } from '../../../../platform/commands/common/commands.js';
import { safeIntl } from '../../../../base/common/date.js';
import { TitleBarVisibleContext } from '../../../common/contextkeys.js';
export interface ITitleVariable {
readonly name: string;
@ -119,11 +120,12 @@ export class BrowserTitleService extends MultiWindowParts<BrowserTitlebarPart> i
title: localize2('focusTitleBar', 'Focus Title Bar'),
category: Categories.View,
f1: true,
precondition: TitleBarVisibleContext
});
}
run(): void {
that.getPartByDocument(getActiveDocument()).focus();
that.getPartByDocument(getActiveDocument())?.focus();
}
}));
}