Skip to content

Commit 20be404

Browse files
committed
touch events: initialize clientX and clientY
this sets clientX and clientY to the values from the first touch in TouchEvent.changedTouches
1 parent 344a6c5 commit 20be404

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/dragelement/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ dragElement.init = function init(options) {
137137
initialEvent = e;
138138
rightClick = e.buttons === 2 || e.ctrlKey;
139139

140+
// fix Fx.hover for touch events
141+
if(typeof e.clientX === 'undefined' && typeof e.clientY === 'undefined') {
142+
e.clientX = startX;
143+
e.clientY = startY;
144+
}
145+
140146
newMouseDownTime = (new Date()).getTime();
141147
if(newMouseDownTime - gd._mouseDownTime < DBLCLICKDELAY) {
142148
// in a click train

0 commit comments

Comments
 (0)