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);