Skip to content

Commit

Permalink
fix(esl-utils): add hasHover device detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Jun 10, 2021
1 parent 423506e commit 2f46dc5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/esl-utils/environment/device-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export abstract class DeviceDetector {
return ('ontouchstart' in window) || ('DocumentTouch' in window && document instanceof Touch);
}

// Hover check
// Note: always true for IE
public static get hasHover() {
return !matchMedia('(hover: none)').matches;
}

static get TOUCH_EVENTS() {
const isTouch = DeviceDetector.isTouchDevice;
return {
Expand Down

0 comments on commit 2f46dc5

Please sign in to comment.