From 2144f9deecccfd0d982052b662afddb7ea025b27 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 12 Sep 2019 10:00:59 +0200 Subject: [PATCH] multipad/range: errors when dragging over when the gesture was initiated on a traversing widget (ie matrix) --- CHANGELOG.md | 1 + src/client/app/widgets/pads/multixy.js | 4 ++++ src/client/app/widgets/sliders/range.js | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63cbead0..abb58d12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - editor: incorrect position when moving a widget from an edge with the keyboard - modal: prevent touchend event from reaching the inner widgets when opening the container - matrix: clone matrices not properly storing their children's values + - multipad/range: errors when dragging over when the gesture was initiated on a traversing widget (ie matrix) - widgets - **new** html widget diff --git a/src/client/app/widgets/pads/multixy.js b/src/client/app/widgets/pads/multixy.js index 14249c3a..812c2727 100644 --- a/src/client/app/widgets/pads/multixy.js +++ b/src/client/app/widgets/pads/multixy.js @@ -138,6 +138,8 @@ module.exports = class MultiXy extends Pad { var i = this.touchMap[e.pointerId] + if (!i) return + this.pads[i].trigger('drag', e) }, {element: this.wrapper[0], multitouch: true}) @@ -146,6 +148,8 @@ module.exports = class MultiXy extends Pad { var i = this.touchMap[e.pointerId] + if (!i) return + e.stopPropagation = true this.pads[i].trigger('dragend', e) diff --git a/src/client/app/widgets/sliders/range.js b/src/client/app/widgets/sliders/range.js index 74c4d846..1e48900e 100644 --- a/src/client/app/widgets/sliders/range.js +++ b/src/client/app/widgets/sliders/range.js @@ -329,6 +329,9 @@ class Range extends Widget { this.on('drag',(e)=>{ var i = this.touchMap[e.pointerId] + + if (!i) return + if (e.shiftKey) { this.faders[0].trigger('drag', e) this.faders[1].trigger('drag', e) @@ -341,6 +344,9 @@ class Range extends Widget { this.on('dragend',(e)=>{ var i = this.touchMap[e.pointerId] + + if (!i) return + e.stopPropagation = true this.faders[i].trigger('dragend', e) delete this.touchMap[e.pointerId]