|
88 | 88 | // Set the flag to prevent other widgets from inheriting the touch event |
89 | 89 | touchHandled = true; |
90 | 90 | // Track movement to determine if interaction was a click |
91 | | - this._touchMoved = false; |
| 91 | + this._touchMoved = 0; |
92 | 92 | // Simulate the mouseover event |
93 | 93 | simulateMouseEvent(event, 'mouseover'); |
94 | 94 | // Simulate the mousemove event |
|
103 | 103 | mouseProto._touchMove = function(event) { |
104 | 104 | // Ignore event if not handled |
105 | 105 | if (!touchHandled) return; |
106 | | - // Interaction was not a click |
107 | | - this._touchMoved = true; |
| 106 | + // Interaction was less likely to be a click |
| 107 | + this._touchMoved +=1; |
108 | 108 | // Simulate the mousemove event |
109 | 109 | simulateMouseEvent(event, 'mousemove'); |
110 | 110 | }; |
|
119 | 119 | simulateMouseEvent(event, 'mouseup'); |
120 | 120 | // Simulate the mouseout event |
121 | 121 | simulateMouseEvent(event, 'mouseout'); |
122 | | - // If the touch interaction did not move, it should trigger a click |
123 | | - if (!this._touchMoved) simulateMouseEvent(event, 'click'); |
| 122 | + // If the touch interaction did not move (much), it should trigger a click |
| 123 | + if (this._touchMoved <= 5) simulateMouseEvent(event, 'click'); |
124 | 124 | // Unset the flag to allow other widgets to inherit the touch event |
125 | 125 | touchHandled = false; |
126 | 126 | }; |
|
0 commit comments