Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on hide of accessibility help, dispose of key listener #186504

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class AccessibleView extends Disposable {
private _editorWidget: CodeEditorWidget;
get editorWidget() { return this._editorWidget; }
private _editorContainer: HTMLElement;
private _keyListener: IDisposable | undefined;

constructor(
@IOpenerService private readonly _openerService: IOpenerService,
Expand Down Expand Up @@ -98,6 +99,7 @@ class AccessibleView extends Disposable {
},
onHide: () => {
provider.onClose();
this._keyListener?.dispose();
}
};
this._contextViewService.showContextView(delegate);
Expand All @@ -123,7 +125,7 @@ class AccessibleView extends Disposable {
model.setLanguage(provider.options.language);
}
container.appendChild(this._editorContainer);
this._register(this._editorWidget.onKeyUp((e) => {
meganrogge marked this conversation as resolved.
Show resolved Hide resolved
this._keyListener = this._register(this._editorWidget.onKeyUp((e) => {
if (e.keyCode === KeyCode.Escape) {
this._contextViewService.hideContextView();
} else if (e.keyCode === KeyCode.KeyD && this._configurationService.getValue(settingKey)) {
Expand Down