From c2fc11293bec4078ceaebabc4ff45c40fa8d9f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Gersen?= Date: Sat, 14 Aug 2021 19:42:08 +0200 Subject: [PATCH] Don't fire change and set events in tap when using snap behaviour (#1106) --- src/nouislider.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nouislider.ts b/src/nouislider.ts index 7ef9bb8d..b2757504 100644 --- a/src/nouislider.ts +++ b/src/nouislider.ts @@ -2213,10 +2213,11 @@ function scope(target: TargetElement, options: ParsedOptions, originalOptions: O fireEvent("slide", handleNumber, true); fireEvent("update", handleNumber, true); - fireEvent("change", handleNumber, true); - fireEvent("set", handleNumber, true); - if (options.events.snap) { + if (!options.events.snap) { + fireEvent("change", handleNumber, true); + fireEvent("set", handleNumber, true); + } else { eventStart(event, { handleNumbers: [handleNumber] }); } }