Skip to content

Commit

Permalink
fix tests; run resetDelayTimeout from mouseleave listeners only if al…
Browse files Browse the repository at this point in the history
…ready showing
  • Loading branch information
margaree committed Jan 22, 2025
1 parent 38cdff0 commit 3735f90
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,7 @@ class Tooltip extends RtlMixin(LitElement) {
_onTargetMouseLeave() {
clearTimeout(this._hoverTimeout);
this._isHovering = false;
if (this.showing) resetDelayTimeout();
setTimeout(() => this._updateShowing(), 100); // delay to allow for mouseenter to fire if hovering on tooltip
}

Expand Down Expand Up @@ -937,7 +938,6 @@ class Tooltip extends RtlMixin(LitElement) {
this._dismissibleId = null;
}
if (dispatch) {
resetDelayTimeout();
this.dispatchEvent(new CustomEvent(
'd2l-tooltip-hide', { bubbles: true, composed: true }
));
Expand Down Expand Up @@ -1033,6 +1033,7 @@ class Tooltip extends RtlMixin(LitElement) {

this.#isHoveringTooltip = false;
this.#mouseLeftTooltip = true;
resetDelayTimeout();

this._mouseLeaveTimeout = setTimeout(() => {
this.#mouseLeftTooltip = false;
Expand Down

0 comments on commit 3735f90

Please sign in to comment.