Skip to content

Commit

Permalink
Merge pull request #60 from squidit/bugfix/tooltip-browser
Browse files Browse the repository at this point in the history
Fix touch bug
  • Loading branch information
JoaoBianco committed May 20, 2024
2 parents f70b5a4 + 91fbcf6 commit 058592b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/directives/sq-tooltip/sq-tooltip.directive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DOCUMENT } from '@angular/common'
import { Directive, ElementRef, HostListener, Inject, Input, OnDestroy, OnInit, Renderer2, TemplateRef, ViewContainerRef } from '@angular/core'
import { NavigationEnd, Router } from '@angular/router'
import { sleep } from '../../helpers/sleep.helper'
import { DOCUMENT } from '@angular/common'
import { GetWindow } from '../../helpers/window.helper'

/**
Expand Down Expand Up @@ -152,7 +152,8 @@ export class SqTooltipDirective implements OnInit, OnDestroy {
isTouch(): boolean {
const window = this.getWindow.window()
if (window) {
return 'ontouchstart' in window || window.navigator.maxTouchPoints > 0
const maxTouchPoints = navigator.maxTouchPoints & 0xff
return 'ontouchstart' in window || maxTouchPoints > 0
}
return false
}
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@squidit/ngx-css",
"version": "1.3.32",
"version": "1.3.33",
"peerDependencies": {
"@angular/common": ">=15.0.0",
"@angular/core": ">=15.0.0",
Expand Down

0 comments on commit 058592b

Please sign in to comment.