Change:
Testing !
That's right. Its because we are using hover infrastructure in the bg.

Discussion:
* element's container hiding on `focusout`. */ container?: HTMLElement; <ins> /** * Whether to make the hover sticky, this means it will not be hidden when the mouse leaves the hover. */ sticky?: boolean; </ins> } export interface IHoverAction {

import { HoverWidget } from 'vs/workbench/services/hover/browser/hoverWidget'; import { IContextViewProvider, IDelegate } from 'vs/base/browser/ui/contextview/contextview'; import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; <del> import { addDisposableListener, EventType, getActiveElement } from 'vs/base/browser/dom'; </del> <ins> import { addDisposableListener, EventType, getActiveElement, isAncestor } from 'vs/base/browser/dom'; </ins> import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver';

@ILayoutService private readonly _layoutService: ILayoutService, @IAccessibilityService private readonly _accessibilityService: IAccessibilityService ) { <del> contextMenuService.onDidShowContextMenu(() => this.hideHover()); </del> <ins> contextMenuService.onDidShowContextMenu(() => this.doHideHover()); </ins> } showHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean): IHoverWidget | undefined { if (getHoverOptionsIdentity(this._currentHoverOptions) === getHoverOptionsIdentity(options)) { return undefined; } <ins> if (this._currentHover && this._currentHoverOptions?.sticky) { return undefined; } </ins> this._currentHoverOptions = options; this._lastHoverOptions = options; const trapFocus = options.trapFocus || this._accessibilityService.isScreenReaderOptimized();

} const hoverDisposables = new DisposableStore(); const hover = this._instantiationService.createInstance(HoverWidget, options); <ins> if (options.sticky) { hover.isLocked = true; } </ins> hover.onDispose(() => { // Required to handle cases such as closing the hover with the escape key this._lastFocusedElementBeforeOpen?.focus();

options.container ); hover.onRequestLayout(() => provider.layout()); <del> if ('targetElements' in options.target) { for (const element of options.target.targetElements) { hoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover())); } </del> <ins> if (options.sticky) { hoverDisposables.add(addDisposableListener(document, EventType.MOUSE_DOWN, e => { if (!isAncestor(e.target as HTMLElement, hover.domNode)) { this.doHideHover(); } })); </ins> } else { <del> hoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover())); } const focusedElement = getActiveElement(); if (focusedElement) { hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.hideOnKeyDown))); hoverDisposables.add(addDisposableListener(document, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.hideOnKeyDown))); hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover))); hoverDisposables.add(addDisposableListener(document, EventType.KEY_UP, e => this._keyUp(e, hover))); </del> <ins> if ('targetElements' in options.target) { for (const element of options.target.targetElements) { hoverDisposables.add(addDisposableListener(element, EventType.CLICK, () => this.hideHover())); } } else { hoverDisposables.add(addDisposableListener(options.target, EventType.CLICK, () => this.hideHover())); } const focusedElement = getActiveElement(); if (focusedElement) { hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.hideOnKeyDown))); hoverDisposables.add(addDisposableListener(document, EventType.KEY_DOWN, e => this._keyDown(e, hover, !!options.hideOnKeyDown))); hoverDisposables.add(addDisposableListener(focusedElement, EventType.KEY_UP, e => this._keyUp(e, hover))); hoverDisposables.add(addDisposableListener(document, EventType.KEY_UP, e => this._keyUp(e, hover))); } </ins> } if ('IntersectionObserver' in window) {

if (this._currentHover?.isLocked || !this._currentHoverOptions) { return; } <ins> this.doHideHover(); } private doHideHover(): void { </ins> this._currentHover = undefined; this._currentHoverOptions = undefined; this._contextViewService.hideContextView();

target: profileIconElement, hoverPosition: HoverPosition.BELOW, showPointer: true, <del> hideOnHover: false, </del> <ins> sticky: true, </ins> }, true); if (hoverWidget) { iconSelectBox.layout(dimension);