Check if focus changed (fixes #101657)
This commit is contained in:
parent
efca601d69
commit
376d9d9d78
1 changed files with 5 additions and 4 deletions
|
@ -1230,10 +1230,10 @@ export class QuickInputController extends Disposable {
|
|||
this.previousFocusElement = e.relatedTarget instanceof HTMLElement ? e.relatedTarget : undefined;
|
||||
}, true));
|
||||
this._register(focusTracker.onDidBlur(() => {
|
||||
this.previousFocusElement = undefined;
|
||||
if (!this.getUI().ignoreFocusOut && !this.options.ignoreFocusOut()) {
|
||||
this.hide(true);
|
||||
this.hide();
|
||||
}
|
||||
this.previousFocusElement = undefined;
|
||||
}));
|
||||
this._register(dom.addDisposableListener(container, dom.EventType.FOCUS, (e: FocusEvent) => {
|
||||
inputBox.setFocus();
|
||||
|
@ -1574,13 +1574,14 @@ export class QuickInputController extends Disposable {
|
|||
}
|
||||
}
|
||||
|
||||
hide(focusLost?: boolean) {
|
||||
hide() {
|
||||
const controller = this.controller;
|
||||
if (controller) {
|
||||
const focusChanged = !this.ui?.container.contains(document.activeElement);
|
||||
this.controller = null;
|
||||
this.onHideEmitter.fire();
|
||||
this.getUI().container.style.display = 'none';
|
||||
if (!focusLost) {
|
||||
if (!focusChanged) {
|
||||
if (this.previousFocusElement && this.previousFocusElement.offsetParent) {
|
||||
this.previousFocusElement.focus();
|
||||
this.previousFocusElement = undefined;
|
||||
|
|
Loading…
Reference in a new issue