Skip to content

A platform for community discussion. Free, open, simple.

FIX: ensures we have touches when starting pan event (#7435)

Joffrey JAFFEUXe386fa7674d5
diff --git a/app/assets/javascripts/discourse/mixins/pan-events.js.es6 b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
index 423fb1c8a55..2b4dc4dd1e7 100644
--- a/app/assets/javascripts/discourse/mixins/pan-events.js.es6
+++ b/app/assets/javascripts/discourse/mixins/pan-events.js.es6
@@ -24,7 +24,7 @@ export default Ember.Mixin.create({
addTouchListeners($element) {
if (this.site.mobileView) {
$element
- .on("touchstart", e => this._panStart(e.touches[0]))
+ .on("touchstart", e => e.touches && this._panStart(e.touches[0]))
.on("touchmove", e => {
const touchEvent = e.touches[0];
touchEvent.type = "pointermove";