From 9e3ad1d80221ec4598ec9024458b75d4875c7402 Mon Sep 17 00:00:00 2001
From: Alexis BENOIT <alex@noesya.coop>
Date: Fri, 22 Nov 2024 16:31:55 +0100
Subject: [PATCH] Slider : correction du drag'n'drop (#745)

---
 assets/js/theme/design-system/TouchControl.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/assets/js/theme/design-system/TouchControl.js b/assets/js/theme/design-system/TouchControl.js
index 91d20b86..e6b3788d 100644
--- a/assets/js/theme/design-system/TouchControl.js
+++ b/assets/js/theme/design-system/TouchControl.js
@@ -120,27 +120,26 @@ osuny.TouchControl.prototype.onEnd = function (event) {
     }
 
     this.dispatch(event);
-
-    this.clear();
 };
 
 osuny.TouchControl.prototype.dispatch = function (event) {
     var threshold = this.options.threshold.action;
 
     this.state.end = osuny.utils.getEventClientCoord(event);
-
+    
     if (this.state.start.x > this.state.end.x + threshold) {
         this.parent.next();
     } else if (this.state.start.x < this.state.end.x - threshold) {
         this.parent.previous();
     }
 
+    this.clear();
+
     if (this.parent['release']) {
         this.parent.release();
     }
 };
 
-
 osuny.TouchControl.prototype.preventClicks = function (event) {
     if (this.state.shouldPreventClicks && event.type === 'click') {
         event.preventDefault();
-- 
GitLab