Skip to content

Commit

Permalink
fix(useSlider): fix value changing after click with disabled prop
Browse files Browse the repository at this point in the history
Добавил проверку на проп `disabled` в обработчике `onSliderClick`.
  • Loading branch information
belk1ng committed Nov 17, 2024
1 parent 88c9a63 commit 02ea45f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Slider/useSlider/useSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function useSlider<RANGE extends boolean>(
}, []);

const onSliderClick = (e: React.MouseEvent) => {
if (isNotRangeParams(props)) {
if (isNotRangeParams(props) && !disabled) {
const positionValue = getValueByPosition(
{ x: e.pageX, y: e.pageY },
sliderRef,
Expand Down

0 comments on commit 02ea45f

Please sign in to comment.