Skip to content

Commit

Permalink
v4.5.1: hide tooltip on click
Browse files Browse the repository at this point in the history
  • Loading branch information
fergusean committed Aug 20, 2024
1 parent d808a40 commit bc881a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@signal24/vue-foundation",
"type": "module",
"version": "4.15.0",
"version": "4.15.1",
"description": "Common components, directives, and helpers for Vue 3 apps",
"module": "./dist/vue-foundation.es.js",
"exports": {
Expand Down
4 changes: 4 additions & 0 deletions src/directives/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ interface ITooltipOptions {
class?: string | string[];
}

// todo: improve with mutation observer to see removal of node

class VfTooltip {
private lastMoveEvt?: MouseEvent;
private checkInterval?: ReturnType<typeof setInterval>;
Expand All @@ -66,6 +68,7 @@ class VfTooltip {
) {
el.addEventListener('mouseenter', this.handleTargetMouseEnterWithContext);
el.addEventListener('mouseleave', this.handleTargetMouseLeaveWithContext);
el.addEventListener('click', this.handleTargetMouseLeaveWithContext);
}

configure(config: ITooltipOptions) {
Expand Down Expand Up @@ -189,5 +192,6 @@ class VfTooltip {

this.el.removeEventListener('mouseenter', this.handleTargetMouseEnterWithContext);
this.el.removeEventListener('mouseleave', this.handleTargetMouseLeaveWithContext);
this.el.removeEventListener('click', this.handleTargetMouseLeaveWithContext);
}
}

0 comments on commit bc881a6

Please sign in to comment.