From 4283c6c8bc9fdbff81d31ad4e73fba56786b3614 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 9 May 2019 14:29:54 +0200 Subject: [PATCH] Fixes #71580: Prevent focus leaving the editor when clicking the light bulb --- src/vs/editor/contrib/codeAction/lightBulbWidget.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts index 6486a8ec02afc..e0d3dcf26f013 100644 --- a/src/vs/editor/contrib/codeAction/lightBulbWidget.ts +++ b/src/vs/editor/contrib/codeAction/lightBulbWidget.ts @@ -45,13 +45,14 @@ export class LightBulbWidget extends Disposable implements IContentWidget { this._futureFixes.cancel(); } })); - this._register(dom.addStandardDisposableListener(this._domNode, 'click', e => { + this._register(dom.addStandardDisposableListener(this._domNode, 'mousedown', e => { if (this._state.type !== CodeActionsState.Type.Triggered) { return; } // Make sure that focus / cursor location is not lost when clicking widget icon this._editor.focus(); + e.preventDefault(); // a bit of extra work to make sure the menu // doesn't cover the line-text const { top, height } = dom.getDomNodePagePosition(this._domNode);