diff options
author | Justin Chen <54879025+justschen@users.noreply.github.com> | 2022-08-10 01:19:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 01:19:40 +0300 |
commit | 0eac052eb7f7bcd42c587f91b300fd07b89a3ba2 (patch) | |
tree | 2a0457548dac85847f2e8b7a765987dd66bc3fec /src/vs | |
parent | a7f9339b68ddd8a9fda45f330c7bc36e18ac0209 (diff) |
Bugfix on preselected options in code action widget (#157694)
* blocking hover on code action widget startup
* added fix on accidental hover - code action widget
Diffstat (limited to 'src/vs')
-rw-r--r-- | src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts | 16 | ||||
-rw-r--r-- | src/vs/editor/contrib/codeAction/browser/media/action.css | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts b/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts index 74581bc44ae..56e77c0397f 100644 --- a/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts +++ b/src/vs/editor/contrib/codeAction/browser/codeActionMenu.ts @@ -167,6 +167,7 @@ export class CodeActionMenu extends Disposable implements IEditorContribution { private currSelectedItem: number | undefined; private hasSeparator: boolean = false; private block?: HTMLElement; + private pointerBlock?: HTMLElement; public static readonly documentationID: string = '_documentation'; @@ -283,6 +284,21 @@ export class CodeActionMenu extends Disposable implements IEditorContribution { }, [this.listRenderer], { keyboardSupport: false } ); + const pointerBlockDiv = document.createElement('div'); + this.pointerBlock = element.appendChild(pointerBlockDiv); + this.pointerBlock.classList.add('context-view-pointerBlock'); + this.pointerBlock.style.position = 'fixed'; + this.pointerBlock.style.cursor = 'initial'; + this.pointerBlock.style.left = '0'; + this.pointerBlock.style.top = '0'; + this.pointerBlock.style.width = '100%'; + this.pointerBlock.style.height = '100%'; + this.pointerBlock.style.zIndex = '2'; + + // Removes block on click INSIDE widget or ANY mouse movement + renderDisposables.add(dom.addDisposableListener(this.pointerBlock, dom.EventType.POINTER_MOVE, () => this.pointerBlock?.remove())); + renderDisposables.add(dom.addDisposableListener(this.pointerBlock, dom.EventType.MOUSE_DOWN, () => this.pointerBlock?.remove())); + renderDisposables.add(this.codeActionList.value.onMouseClick(e => this._onListClick(e))); renderDisposables.add(this.codeActionList.value.onMouseOver(e => this._onListHover(e))); renderDisposables.add(this.codeActionList.value.onDidChangeFocus(e => this.codeActionList.value?.domFocus())); diff --git a/src/vs/editor/contrib/codeAction/browser/media/action.css b/src/vs/editor/contrib/codeAction/browser/media/action.css index 9d442e57d47..0bcc1ccf74f 100644 --- a/src/vs/editor/contrib/codeAction/browser/media/action.css +++ b/src/vs/editor/contrib/codeAction/browser/media/action.css @@ -30,8 +30,8 @@ z-index: 5; /* make sure we are on top of the tree items */ content: ""; pointer-events: none; /* enable click through */ - outline: 0px solid; /* we still need to handle the empty tree or no focus item case */ - outline-width: 0px; + outline: 0px solid !important; /* we still need to handle the empty tree or no focus item case */ + outline-width: 0px !important; outline-style: none; outline-offset: 0px; } |