Skip to content

Commit d0a179c

Browse files
committed
fix part of microsoft#188822
1 parent 5b4a382 commit d0a179c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,16 @@ class HoverAccessibleViewContribution extends Disposable {
114114
const codeEditorService = accessor.get(ICodeEditorService);
115115
const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
116116
const editorHoverContent = editor ? ModesHoverController.get(editor)?.getWidgetContent() ?? undefined : undefined;
117-
if (!editorHoverContent) {
117+
if (!editor || !editorHoverContent) {
118118
return false;
119119
}
120120
this._options.language = editor?.getModel()?.getLanguageId() ?? undefined;
121121
accessibleViewService.show({
122122
verbositySettingKey: AccessibilityVerbositySettingId.Hover,
123123
provideContent() { return editorHoverContent; },
124-
onClose() { },
124+
onClose() {
125+
ModesHoverController.get(editor)?.focus();
126+
},
125127
options: this._options
126128
});
127129
return true;

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ class AccessibleView extends Disposable {
211211
this._configurationService.updateValue(settingKey, false);
212212
}
213213
provider.onKeyDown?.(e);
214-
// e.stopPropagation();
215214
}));
216215
disposableStore.add(this._editorWidget.onKeyDown((e) => {
217216
if (e.keyCode === KeyCode.Escape) {

src/vs/workbench/services/hover/browser/hoverService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ function getHoverOptionsIdentity(options: IHoverOptions | undefined): IHoverOpti
145145

146146
class HoverContextViewDelegate implements IDelegate {
147147

148+
container: HTMLElement | undefined;
149+
148150
get anchorPosition() {
149151
return this._hover.anchor;
150152
}
@@ -156,6 +158,7 @@ class HoverContextViewDelegate implements IDelegate {
156158
}
157159

158160
render(container: HTMLElement) {
161+
this.container = container;
159162
this._hover.render(container);
160163
if (this._focus) {
161164
this._hover.focus();

0 commit comments

Comments
 (0)