Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! Feat(web): Tooltip hover
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Feb 12, 2024
1 parent b3f0ecc commit 764d45a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/web/src/js/Tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Tooltip extends BaseComponent {
}

hide() {
console.log('this.isShown():', this.isShown());
if (!this.isShown()) {
return;
}
Expand Down Expand Up @@ -356,11 +357,13 @@ class Tooltip extends BaseComponent {
}

autoCloseHandler = (event: Event) => {
const shouldClose = this.trigger && clickOutsideElement(this.trigger, event);
const id = this.tip.getAttribute('id') as string;
const trigger = document.querySelector(`[data-spirit-target="#${id}"]`) as HTMLElement;

const shouldClose = trigger && clickOutsideElement(trigger, event);
if (event.target && shouldClose) {
this.activeTrigger[TRIGGER_CLICK] = false;
this.activeTrigger[TRIGGER_HOVER] = false;

this.leave();
}
};
Expand Down

0 comments on commit 764d45a

Please sign in to comment.