From 02ea45f3c847db1ed9cf0b50fc2e20dfd550a80e Mon Sep 17 00:00:00 2001 From: belk1ng Date: Sun, 17 Nov 2024 21:47:04 +0300 Subject: [PATCH] fix(useSlider): fix value changing after click with disabled prop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил проверку на проп `disabled` в обработчике `onSliderClick`. --- src/components/Slider/useSlider/useSlider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Slider/useSlider/useSlider.ts b/src/components/Slider/useSlider/useSlider.ts index 74d046873..8865d41d0 100644 --- a/src/components/Slider/useSlider/useSlider.ts +++ b/src/components/Slider/useSlider/useSlider.ts @@ -157,7 +157,7 @@ export function useSlider( }, []); const onSliderClick = (e: React.MouseEvent) => { - if (isNotRangeParams(props)) { + if (isNotRangeParams(props) && !disabled) { const positionValue = getValueByPosition( { x: e.pageX, y: e.pageY }, sliderRef,