mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Merge pull request #208829 from microsoft/merogge/tab-focus
set tab focus when editable widget focused
This commit is contained in:
commit
1d122e94cf
|
@ -44,6 +44,7 @@ import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreve
|
|||
import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
||||
import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
||||
import { IMarkdownVulnerability } from '../common/annotations';
|
||||
import { TabFocus } from 'vs/editor/browser/config/tabFocus';
|
||||
|
||||
const $ = dom.$;
|
||||
|
||||
|
@ -334,6 +335,10 @@ export class CodeBlockPart extends Disposable {
|
|||
await this.updateEditor(data);
|
||||
|
||||
this.layout(width);
|
||||
if (editable) {
|
||||
this._register(this.editor.onDidFocusEditorWidget(() => TabFocus.setTabFocusMode(true)));
|
||||
this._register(this.editor.onDidBlurEditorWidget(() => TabFocus.setTabFocusMode(false)));
|
||||
}
|
||||
this.editor.updateOptions({ ariaLabel: localize('chat.codeBlockLabel', "Code block {0}", data.codeBlockIndex + 1), readOnly: !editable });
|
||||
|
||||
if (data.hideToolbar) {
|
||||
|
|
Loading…
Reference in a new issue