Skip to content

Commit

Permalink
Merge pull request #74302 from microsoft/alex/71580
Browse files Browse the repository at this point in the history
Fixes #71580: Prevent focus leaving the editor when clicking the light bulb
  • Loading branch information
alexdima authored May 24, 2019
2 parents 89d3e98 + 4283c6c commit 16213d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vs/editor/contrib/codeAction/lightBulbWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 16213d1

Please sign in to comment.