mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
focus owning editor when clicking into zone without having editor widget focus (#212878)
fixes https://github.com/microsoft/vscode-copilot/issues/5410
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { Dimension } from 'vs/base/browser/dom';
|
||||
import { addDisposableListener, Dimension } from 'vs/base/browser/dom';
|
||||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { assertType } from 'vs/base/common/types';
|
||||
@@ -81,6 +81,13 @@ export class InlineChatZoneWidget extends ZoneWidget {
|
||||
this._disposables.add(this.widget);
|
||||
this.create();
|
||||
|
||||
this._disposables.add(addDisposableListener(this.domNode, 'click', e => {
|
||||
if (!this.editor.hasWidgetFocus() && !this.widget.hasFocus()) {
|
||||
this.editor.focus();
|
||||
}
|
||||
}, true));
|
||||
|
||||
|
||||
// todo@jrieken listen ONLY when showing
|
||||
const updateCursorIsAboveContextKey = () => {
|
||||
if (!this.position || !this.editor.hasModel()) {
|
||||
|
||||
Reference in New Issue
Block a user