@@ -2,7 +2,6 @@ import { getNode, getNodeId, isValidNode } from '../lib/nodeManager'
22import { pushNodesToFrontend } from './DOM'
33import $ from 'licia/$'
44import h from 'licia/h'
5- import isMobile from 'licia/isMobile'
65import evalCss from 'licia/evalCss'
76import defaults from 'licia/defaults'
87import extend from 'licia/extend'
@@ -21,6 +20,7 @@ const showInfo = cssSupports(
2120 'clip-path' ,
2221 'polygon(50% 0px, 0px 100%, 100% 100%)'
2322)
23+ const hasTouchSupport = 'ontouchstart' in root
2424
2525const css = require ( 'luna-dom-highlighter/luna-dom-highlighter.css' ) . replace (
2626 '/*# sourceMappingURL=luna-dom-highlighter.css.map*/' ,
@@ -126,9 +126,9 @@ export function setInspectMode(params: any) {
126126}
127127
128128function getElementFromPoint ( e : any ) {
129- if ( isMobile ( ) ) {
129+ if ( hasTouchSupport ) {
130130 const touch = e . touches [ 0 ] || e . changedTouches [ 0 ]
131- return document . elementFromPoint ( touch . pageX , touch . pageY )
131+ return document . elementFromPoint ( touch . clientX , touch . clientY )
132132 }
133133
134134 return document . elementFromPoint ( e . clientX , e . clientY )
@@ -185,7 +185,7 @@ function clickListener(e: any) {
185185function addEvent ( type : string , listener : any ) {
186186 document . documentElement . addEventListener ( type , listener , true )
187187}
188- if ( isMobile ( ) ) {
188+ if ( hasTouchSupport ) {
189189 addEvent ( 'touchstart' , moveListener )
190190 addEvent ( 'touchmove' , moveListener )
191191 addEvent ( 'touchend' , clickListener )
0 commit comments