mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-15 16:34:50 +01:00
Fixes microsoft/monaco-editor#2339: Listen to focusin and focusout and refresh the dom focus tracker state
This commit is contained in:
@@ -908,7 +908,7 @@ export const EventHelper = {
|
||||
export interface IFocusTracker extends Disposable {
|
||||
onDidFocus: Event<void>;
|
||||
onDidBlur: Event<void>;
|
||||
refreshState?(): void;
|
||||
refreshState(): void;
|
||||
}
|
||||
|
||||
export function saveParentsScrollTop(node: Element): number[] {
|
||||
|
||||
@@ -2007,6 +2007,12 @@ class CodeEditorWidgetFocusTracker extends Disposable {
|
||||
this._hasFocus = false;
|
||||
this._onChange.fire(undefined);
|
||||
}));
|
||||
this._register(dom.addDisposableListener(domElement, 'focusin', () => {
|
||||
this._domFocusTracker.refreshState();
|
||||
}));
|
||||
this._register(dom.addDisposableListener(domElement, 'focusout', () => {
|
||||
this._domFocusTracker.refreshState();
|
||||
}));
|
||||
}
|
||||
|
||||
public hasFocus(): boolean {
|
||||
|
||||
Reference in New Issue
Block a user