Skip to content

Commit

Permalink
fix: use pointer events for touch devices
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell authored Nov 16, 2024
1 parent 550b6b9 commit 3240ce2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ export class SmartTooltip {
}

private setupEventListeners() {
document.addEventListener('mouseover', this.handleMouseOver)
document.addEventListener('mouseout', this.handleMouseOut)
document.addEventListener('pointerenter', this.handleMouseOver)
document.addEventListener('pointerleave', this.handleMouseOut)
document.addEventListener('click', this.handleClick)
window.addEventListener('resize', this.handleResize)
window.addEventListener('scroll', this.handleScroll, true)
Expand Down Expand Up @@ -244,8 +244,8 @@ export class SmartTooltip {
}

public destroy(): void {
document.removeEventListener('mouseover', this.handleMouseOver)
document.removeEventListener('mouseout', this.handleMouseOut)
document.removeEventListener('pointerenter', this.handleMouseOver)
document.removeEventListener('pointerleave', this.handleMouseOut)
document.removeEventListener('click', this.handleClick)
window.removeEventListener('resize', this.handleResize)
window.removeEventListener('scroll', this.handleScroll, true)
Expand Down

0 comments on commit 3240ce2

Please sign in to comment.