diff --git a/packages/menu-bar/src/vaadin-menu-bar-mixin.js b/packages/menu-bar/src/vaadin-menu-bar-mixin.js index d7913f3230..09cac21d8b 100644 --- a/packages/menu-bar/src/vaadin-menu-bar-mixin.js +++ b/packages/menu-bar/src/vaadin-menu-bar-mixin.js @@ -250,7 +250,7 @@ export const MenuBarMixin = (superClass) => }); this.addController(this._overflowController); - this.addEventListener('mousedown', () => this._hideTooltip()); + this.addEventListener('mousedown', () => this._hideTooltip(true)); this.addEventListener('mouseleave', () => this._hideTooltip()); this._subMenu.addEventListener('item-selected', this.__onItemSelected.bind(this)); diff --git a/packages/tooltip/src/vaadin-tooltip-mixin.js b/packages/tooltip/src/vaadin-tooltip-mixin.js index 0e8a7a8300..ed9309f041 100644 --- a/packages/tooltip/src/vaadin-tooltip-mixin.js +++ b/packages/tooltip/src/vaadin-tooltip-mixin.js @@ -653,6 +653,10 @@ export const TooltipMixin = (superClass) => /** @private */ __onMouseDown() { + if (this.manual) { + return; + } + this._stateController.close(true); } diff --git a/packages/tooltip/test/tooltip.common.js b/packages/tooltip/test/tooltip.common.js index b9b5e83785..c3b1f90243 100644 --- a/packages/tooltip/test/tooltip.common.js +++ b/packages/tooltip/test/tooltip.common.js @@ -799,6 +799,12 @@ describe('vaadin-tooltip', () => { expect(overlay.opened).to.be.true; }); + it('should not close overlay on target mousedown', () => { + tooltip.opened = true; + mousedown(target); + expect(overlay.opened).to.be.true; + }); + it('should close overlay when opened is set to false', () => { tooltip.opened = true;