From ee0489a58c892cf68b9ab6d7acfa8302a85980a5 Mon Sep 17 00:00:00 2001 From: Joon Shin Date: Mon, 22 Jan 2024 15:23:18 +1300 Subject: [PATCH] fixing variable name to not adding classname infinitely --- dist/perfect-scrollbar.js | 4 ++-- src/handlers/drag-thumb.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/perfect-scrollbar.js b/dist/perfect-scrollbar.js index 0f8e4b5..89ef62e 100644 --- a/dist/perfect-scrollbar.js +++ b/dist/perfect-scrollbar.js @@ -576,10 +576,10 @@ let scrollBy = null; function mouseMoveHandler(e) { - const y = e.touches && e.touches[0] ? e.touches[0].pageY : e[pageY]; + const py = e.touches && e.touches[0] ? e.touches[0].pageY : e[pageY]; element[scrollTop] = - startingScrollTop + scrollBy * (y - startingMousePageY); + startingScrollTop + scrollBy * (py - startingMousePageY); addScrollingClass(i, y); updateGeometry(i); diff --git a/src/handlers/drag-thumb.js b/src/handlers/drag-thumb.js index b953088..66ecbfc 100644 --- a/src/handlers/drag-thumb.js +++ b/src/handlers/drag-thumb.js @@ -53,10 +53,10 @@ function bindMouseScrollHandler( let scrollBy = null; function mouseMoveHandler(e) { - const y = e.touches && e.touches[0] ? e.touches[0].pageY : e[pageY]; + const py = e.touches && e.touches[0] ? e.touches[0].pageY : e[pageY]; element[scrollTop] = - startingScrollTop + scrollBy * (y - startingMousePageY); + startingScrollTop + scrollBy * (py - startingMousePageY); addScrollingClass(i, y); updateGeometry(i);