From 478e95070310a42d25071665043a09730087a90b Mon Sep 17 00:00:00 2001 From: "maciej.lodygowski" Date: Tue, 10 Sep 2024 18:30:40 +0200 Subject: [PATCH 1/6] fix: check for invalid configuration in limit settings --- .../com/reactnativecommunity/slider/ReactSlider.java | 11 +++++++++++ .../slider/ReactSliderManager.java | 9 ++------- .../slider/ReactSliderManager.java | 9 ++------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java index b4eeed3c..f9a3be47 100644 --- a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java +++ b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java @@ -104,6 +104,17 @@ private void disableStateListAnimatorIfNeeded() { updateAll(); } + /*package*/ int getValidProgressValue(int progress) { + if (getLowerLimit() <= getUpperLimit()) { + if (progress < getLowerLimit()) { + progress = getLowerLimit(); + } else if (progress > getUpperLimit()) { + progress = getUpperLimit(); + } + } + return progress; + } + /* package */ void setValue(double value) { mValue = value; updateValue(); diff --git a/package/android/src/newarch/java/com/reactnativecommunity/slider/ReactSliderManager.java b/package/android/src/newarch/java/com/reactnativecommunity/slider/ReactSliderManager.java index c780b8a4..05087685 100644 --- a/package/android/src/newarch/java/com/reactnativecommunity/slider/ReactSliderManager.java +++ b/package/android/src/newarch/java/com/reactnativecommunity/slider/ReactSliderManager.java @@ -48,13 +48,8 @@ protected ViewManagerDelegate getDelegate() { public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) { ReactSlider slider = (ReactSlider)seekbar; - if(progress < slider.getLowerLimit()) { - progress = slider.getLowerLimit(); - seekbar.setProgress(progress); - } else if (progress > slider.getUpperLimit()) { - progress = slider.getUpperLimit(); - seekbar.setProgress(progress); - } + progress = slider.getValidProgressValue(progress); + seekbar.setProgress(progress); ReactContext reactContext = (ReactContext) seekbar.getContext(); int reactTag = seekbar.getId(); diff --git a/package/android/src/oldarch/java/com/reactnativecommunity/slider/ReactSliderManager.java b/package/android/src/oldarch/java/com/reactnativecommunity/slider/ReactSliderManager.java index 05482018..2f8eb6ea 100644 --- a/package/android/src/oldarch/java/com/reactnativecommunity/slider/ReactSliderManager.java +++ b/package/android/src/oldarch/java/com/reactnativecommunity/slider/ReactSliderManager.java @@ -30,13 +30,8 @@ public class ReactSliderManager extends SimpleViewManager { public void onProgressChanged(SeekBar seekbar, int progress, boolean fromUser) { ReactSlider slider = (ReactSlider)seekbar; - if(progress < slider.getLowerLimit()) { - progress = slider.getLowerLimit(); - seekbar.setProgress(progress); - } else if(progress > slider.getUpperLimit()) { - progress = slider.getUpperLimit(); - seekbar.setProgress(progress); - } + progress = slider.getValidProgressValue(progress); + seekbar.setProgress(progress); ReactContext reactContext = (ReactContext) seekbar.getContext(); if(fromUser) { From 79880858b590e86b0ea1a7af6c6e263371c79e3f Mon Sep 17 00:00:00 2001 From: "maciej.lodygowski" Date: Fri, 13 Sep 2024 12:47:02 +0200 Subject: [PATCH 2/6] fix: add limit check with warning --- .../slider/ReactSlider.java | 33 +++++++++----- package/ios/RNCSlider.m | 10 ++++- package/ios/RNCSliderComponentView.mm | 44 ++++++++++++------- package/ios/RNCSliderManager.m | 22 +++++++++- package/src/Slider.tsx | 14 +++++- 5 files changed, 91 insertions(+), 32 deletions(-) diff --git a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java index f9a3be47..858fa7dc 100644 --- a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java +++ b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java @@ -11,6 +11,7 @@ import android.graphics.BitmapFactory; import android.graphics.drawable.BitmapDrawable; import android.os.Build; +import android.util.Log; import android.util.AttributeSet; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; @@ -105,15 +106,13 @@ private void disableStateListAnimatorIfNeeded() { } /*package*/ int getValidProgressValue(int progress) { - if (getLowerLimit() <= getUpperLimit()) { - if (progress < getLowerLimit()) { - progress = getLowerLimit(); - } else if (progress > getUpperLimit()) { - progress = getUpperLimit(); - } + if (progress < getLowerLimit()) { + progress = getLowerLimit(); + } else if (progress > getUpperLimit()) { + progress = getUpperLimit(); } return progress; - } + } /* package */ void setValue(double value) { mValue = value; @@ -233,16 +232,28 @@ private void updateAll() { updateValue(); } - /** Update limit based on props limit, max and min */ + /** Update limit based on props limit, max and min + * Fallback to upper limit if invalid configuration provided + */ private void updateLowerLimit() { double limit = Math.max(mRealLowerLimit, mMinValue); - mLowerLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); + int lowerLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); + if(lowerLimit > mUpperLimit) { + Log.w("Invalid configuration", "reverting lower limit to upper limit"); + } + mLowerLimit = Math.min(lowerLimit, mUpperLimit); } - /** Update limit based on props limit, max and min */ + /** Update limit based on props limit, max and min + * Fallback to lower limit if invalid configuration provided + */ private void updateUpperLimit() { double limit = Math.min(mRealUpperLimit, mMaxValue); - mUpperLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); + int upperLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); + if(mLowerLimit > upperLimit) { + Log.w("Invalid configuration", "reverting upper limit to equal to lower limit"); + } + mUpperLimit = Math.max(upperLimit, mLowerLimit); } /** Update value only (optimization in case only value is set). */ diff --git a/package/ios/RNCSlider.m b/package/ios/RNCSlider.m index c365a310..9b34dc43 100644 --- a/package/ios/RNCSlider.m +++ b/package/ios/RNCSlider.m @@ -14,6 +14,14 @@ @implementation RNCSlider bool _maximumTrackImageSet; } +- (instancetype)init { + if (self = [super init]) { + _upperLimit = FLT_MAX; + _lowerLimit = FLT_MIN; + } + return self; +} + - (instancetype)initWithFrame:(CGRect)frame { return [super initWithFrame:frame]; @@ -46,7 +54,7 @@ - (void)setupAccessibility:(float)value if (sliderValue && [sliderValue intValue] == 1) { spokenUnits = [spokenUnits substringToIndex:stringLength-1]; } - + self.accessibilityValue = [NSString stringWithFormat:@"%@ %@", sliderValue, spokenUnits]; } } diff --git a/package/ios/RNCSliderComponentView.mm b/package/ios/RNCSliderComponentView.mm index ae5298e2..661daddd 100644 --- a/package/ios/RNCSliderComponentView.mm +++ b/package/ios/RNCSliderComponentView.mm @@ -47,12 +47,12 @@ - (instancetype)initWithFrame:(CGRect)frame forControlEvents:(UIControlEventTouchUpInside | UIControlEventTouchUpOutside | UIControlEventTouchCancel)]; - + UITapGestureRecognizer *tapGesturer; tapGesturer = [[UITapGestureRecognizer alloc] initWithTarget: self action:@selector(tapHandler:)]; [tapGesturer setNumberOfTapsRequired: 1]; [slider addGestureRecognizer:tapGesturer]; - + slider.value = (float)defaultProps->value; self.contentView = slider; } @@ -65,12 +65,12 @@ - (void)tapHandler:(UITapGestureRecognizer *)gesture { } RNCSlider *slider = (RNCSlider *)gesture.view; slider.isSliding = _isSliding; - + // Ignore this tap if in the middle of a slide. if (_isSliding) { return; } - + if (!slider.tapToSeek) { return; } @@ -88,14 +88,14 @@ - (void)tapHandler:(UITapGestureRecognizer *)gesture { } [slider setValue:[slider discreteValue:value] animated: YES]; - + std::dynamic_pointer_cast(_eventEmitter) ->onRNCSliderSlidingStart(RNCSliderEventEmitter::OnRNCSliderSlidingStart{.value = static_cast(slider.lastValue)}); - + // Trigger onValueChange to address https://github.com/react-native-community/react-native-slider/issues/212 std::dynamic_pointer_cast(_eventEmitter) ->onRNCSliderValueChange(RNCSliderEventEmitter::OnRNCSliderValueChange{.value = static_cast(slider.value)}); - + std::dynamic_pointer_cast(_eventEmitter) ->onRNCSliderSlidingComplete(RNCSliderEventEmitter::OnRNCSliderSlidingComplete{.value = static_cast(slider.value)}); } @@ -122,7 +122,7 @@ - (void)sliderTouchEnd:(RNCSlider *)sender - (void)RNCSendSliderEvent:(RNCSlider *)sender withContinuous:(BOOL)continuous isSlidingStart:(BOOL)isSlidingStart { float value = [sender discreteValue:sender.value]; - + if (value < sender.lowerLimit) { value = sender.lowerLimit; [sender setValue:value animated:NO]; @@ -134,7 +134,7 @@ - (void)RNCSendSliderEvent:(RNCSlider *)sender withContinuous:(BOOL)continuous i if(!sender.isSliding) { [sender setValue:value animated:NO]; } - + if (continuous) { if (sender.lastValue != value) { std::dynamic_pointer_cast(_eventEmitter) @@ -150,7 +150,7 @@ - (void)RNCSendSliderEvent:(RNCSlider *)sender withContinuous:(BOOL)continuous i ->onRNCSliderSlidingStart(RNCSliderEventEmitter::OnRNCSliderSlidingStart{.value = static_cast(value)}); } } - + sender.lastValue = value; } @@ -158,7 +158,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & { const auto &oldScreenProps = *std::static_pointer_cast(_props); const auto &newScreenProps = *std::static_pointer_cast(props); - + if (oldScreenProps.value != newScreenProps.value) { if (!slider.isSliding) { slider.value = newScreenProps.value; @@ -176,12 +176,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & if (oldScreenProps.maximumValue != newScreenProps.maximumValue) { [slider setMaximumValue:newScreenProps.maximumValue]; } - if (oldScreenProps.lowerLimit != newScreenProps.lowerLimit) { - slider.lowerLimit = newScreenProps.lowerLimit; - } - if (oldScreenProps.upperLimit != newScreenProps.upperLimit) { - slider.upperLimit = newScreenProps.upperLimit; - } + updateLimits(slider, newScreenProps.lowerLimit, newScreenProps.upperLimit); if (oldScreenProps.tapToSeek != newScreenProps.tapToSeek) { slider.tapToSeek = newScreenProps.tapToSeek; } @@ -272,6 +267,21 @@ - (void)loadImageFromImageSource:(ImageSource)source completionBlock:(RNCLoadIma } } +void updateLimits(RNCSlider *slider, float newLowerLimit, float newUpperLimit) { + if (slider.lowerLimit != newLowerLimit) { + slider.lowerLimit = newLowerLimit; + } + + if (slider.upperLimit != newUpperLimit) { + slider.upperLimit = newUpperLimit; + } + + if (slider.lowerLimit > slider.upperLimit) { + NSLog(@"Invalid configuration: lowerLimit > upperLimit, reverting lowerLimit to upperLimit."); + slider.lowerLimit = slider.upperLimit; + } +} + - (void)setInverted:(BOOL)inverted { if (inverted) { diff --git a/package/ios/RNCSliderManager.m b/package/ios/RNCSliderManager.m index 9cc97e1b..e605a9d0 100644 --- a/package/ios/RNCSliderManager.m +++ b/package/ios/RNCSliderManager.m @@ -158,8 +158,26 @@ - (void)sliderTouchEnd:(RNCSlider *)sender RCT_EXPORT_VIEW_PROPERTY(maximumTrackImage, UIImage); RCT_EXPORT_VIEW_PROPERTY(minimumValue, float); RCT_EXPORT_VIEW_PROPERTY(maximumValue, float); -RCT_EXPORT_VIEW_PROPERTY(lowerLimit, float); -RCT_EXPORT_VIEW_PROPERTY(upperLimit, float); +RCT_CUSTOM_VIEW_PROPERTY(lowerLimit, float, RNCSlider) { + float lowerLimit = [RCTConvert float:json]; + + if (lowerLimit > view.upperLimit) { + lowerLimit = view.upperLimit; + NSLog(@"Invalid configuration: reverting upper limit to equal to lower limit") + } + + view.lowerLimit = lowerLimit; +} +RCT_CUSTOM_VIEW_PROPERTY(upperLimit, float, RNCSlider) { + float upperLimit = [RCTConvert float:json]; + + if (upperLimit < view.lowerLimit) { + upperLimit = view.lowerLimit; + NSLog(@"Invalid configuration: reverting lower limit to equal to upper limit") + } + + view.upperLimit = upperLimit; +} RCT_EXPORT_VIEW_PROPERTY(minimumTrackTintColor, UIColor); RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, UIColor); RCT_EXPORT_VIEW_PROPERTY(onRNCSliderValueChange, RCTBubblingEventBlock); diff --git a/package/src/Slider.tsx b/package/src/Slider.tsx index 015b1561..c8cc8573 100644 --- a/package/src/Slider.tsx +++ b/package/src/Slider.tsx @@ -1,4 +1,4 @@ -import React, {useState} from 'react'; +import React, {useCallback, useEffect, useState} from 'react'; import { Image, Platform, @@ -281,6 +281,18 @@ const SliderComponent = ( default: constants.LIMIT_MAX_VALUE, }); + const limitCheck = useCallback(() => { + if (lowerLimit >= upperLimit) { + console.warn( + 'Invalid configuration: lower limit is supposed to me smaller than upper limit', + ); + } + }, [lowerLimit, upperLimit]); + + useEffect(() => { + limitCheck(); + }, [limitCheck, localProps]); + return ( { From ffe8596c98429aed22bfb1e8e3f7592a1d9e7d8b Mon Sep 17 00:00:00 2001 From: "maciej.lodygowski" Date: Wed, 18 Sep 2024 14:16:04 +0200 Subject: [PATCH 3/6] chore: pr improvements --- .../slider/ReactSlider.java | 12 +++++++----- package/ios/RNCSliderManager.m | 18 ++++++++---------- package/src/Slider.tsx | 8 ++------ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java index 858fa7dc..7b698f0d 100644 --- a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java +++ b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java @@ -239,9 +239,10 @@ private void updateLowerLimit() { double limit = Math.max(mRealLowerLimit, mMinValue); int lowerLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); if(lowerLimit > mUpperLimit) { - Log.w("Invalid configuration", "reverting lower limit to upper limit"); + Log.d("Invalid configuration", "upperLimit < lowerLimit; lowerLimit not set"); + }else { + mLowerLimit = Math.min(lowerLimit, mUpperLimit); } - mLowerLimit = Math.min(lowerLimit, mUpperLimit); } /** Update limit based on props limit, max and min @@ -250,10 +251,11 @@ private void updateLowerLimit() { private void updateUpperLimit() { double limit = Math.min(mRealUpperLimit, mMaxValue); int upperLimit = (int) Math.round((limit - mMinValue) / (mMaxValue - mMinValue) * getTotalSteps()); - if(mLowerLimit > upperLimit) { - Log.w("Invalid configuration", "reverting upper limit to equal to lower limit"); + if (mLowerLimit > upperLimit) { + Log.d("Invalid configuration", "upperLimit < lowerLimit; upperLimit not set"); + } else { + mUpperLimit = upperLimit; } - mUpperLimit = Math.max(upperLimit, mLowerLimit); } /** Update value only (optimization in case only value is set). */ diff --git a/package/ios/RNCSliderManager.m b/package/ios/RNCSliderManager.m index e605a9d0..cd88caa3 100644 --- a/package/ios/RNCSliderManager.m +++ b/package/ios/RNCSliderManager.m @@ -162,21 +162,19 @@ - (void)sliderTouchEnd:(RNCSlider *)sender float lowerLimit = [RCTConvert float:json]; if (lowerLimit > view.upperLimit) { - lowerLimit = view.upperLimit; - NSLog(@"Invalid configuration: reverting upper limit to equal to lower limit") - } - - view.lowerLimit = lowerLimit; + NSLog(@"Invalid configuration: upperLimit < lowerLimit; lowerLimit not set") + } else { + view.lowerLimit = lowerLimit; + } } RCT_CUSTOM_VIEW_PROPERTY(upperLimit, float, RNCSlider) { float upperLimit = [RCTConvert float:json]; if (upperLimit < view.lowerLimit) { - upperLimit = view.lowerLimit; - NSLog(@"Invalid configuration: reverting lower limit to equal to upper limit") - } - - view.upperLimit = upperLimit; + NSLog(@"Invalid configuration: upperLimit < lowerLimit; upperLimit not set") + } else { + view.upperLimit = upperLimit; + } } RCT_EXPORT_VIEW_PROPERTY(minimumTrackTintColor, UIColor); RCT_EXPORT_VIEW_PROPERTY(maximumTrackTintColor, UIColor); diff --git a/package/src/Slider.tsx b/package/src/Slider.tsx index c8cc8573..674bdbb7 100644 --- a/package/src/Slider.tsx +++ b/package/src/Slider.tsx @@ -1,4 +1,4 @@ -import React, {useCallback, useEffect, useState} from 'react'; +import React, {useEffect, useState} from 'react'; import { Image, Platform, @@ -281,7 +281,7 @@ const SliderComponent = ( default: constants.LIMIT_MAX_VALUE, }); - const limitCheck = useCallback(() => { + useEffect(() => { if (lowerLimit >= upperLimit) { console.warn( 'Invalid configuration: lower limit is supposed to me smaller than upper limit', @@ -289,10 +289,6 @@ const SliderComponent = ( } }, [lowerLimit, upperLimit]); - useEffect(() => { - limitCheck(); - }, [limitCheck, localProps]); - return ( { From 27864645013d09fb6aec8c712759abf0d5c614a2 Mon Sep 17 00:00:00 2001 From: "maciej.lodygowski" Date: Fri, 20 Sep 2024 18:44:17 +0200 Subject: [PATCH 4/6] fix: pr improvements --- package/ios/RNCSliderComponentView.mm | 30 +++++++++++++-------------- package/ios/RNCSliderManager.m | 4 ++-- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/package/ios/RNCSliderComponentView.mm b/package/ios/RNCSliderComponentView.mm index 661daddd..5f457933 100644 --- a/package/ios/RNCSliderComponentView.mm +++ b/package/ios/RNCSliderComponentView.mm @@ -176,7 +176,20 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared & if (oldScreenProps.maximumValue != newScreenProps.maximumValue) { [slider setMaximumValue:newScreenProps.maximumValue]; } - updateLimits(slider, newScreenProps.lowerLimit, newScreenProps.upperLimit); + if (slider.lowerLimit != newScreenProps.lowerLimit) { + if(newScreenProps.lowerLimit > slider.upperLimit){ + NSLog(@"Invalid configuration: upperLimit < lowerLimit; lowerLimit not set"); + } else { + slider.lowerLimit = newScreenProps.lowerLimit; + } + } + if (slider.upperLimit != newScreenProps.upperLimit) { + if(newScreenProps.upperLimit < slider.lowerLimit){ + NSLog(@"Invalid configuration: upperLimit < lowerLimit; upperLimit not set"); + } else { + slider.upperLimit = newScreenProps.upperLimit; + } + } if (oldScreenProps.tapToSeek != newScreenProps.tapToSeek) { slider.tapToSeek = newScreenProps.tapToSeek; } @@ -267,21 +280,6 @@ - (void)loadImageFromImageSource:(ImageSource)source completionBlock:(RNCLoadIma } } -void updateLimits(RNCSlider *slider, float newLowerLimit, float newUpperLimit) { - if (slider.lowerLimit != newLowerLimit) { - slider.lowerLimit = newLowerLimit; - } - - if (slider.upperLimit != newUpperLimit) { - slider.upperLimit = newUpperLimit; - } - - if (slider.lowerLimit > slider.upperLimit) { - NSLog(@"Invalid configuration: lowerLimit > upperLimit, reverting lowerLimit to upperLimit."); - slider.lowerLimit = slider.upperLimit; - } -} - - (void)setInverted:(BOOL)inverted { if (inverted) { diff --git a/package/ios/RNCSliderManager.m b/package/ios/RNCSliderManager.m index cd88caa3..67c6e958 100644 --- a/package/ios/RNCSliderManager.m +++ b/package/ios/RNCSliderManager.m @@ -162,7 +162,7 @@ - (void)sliderTouchEnd:(RNCSlider *)sender float lowerLimit = [RCTConvert float:json]; if (lowerLimit > view.upperLimit) { - NSLog(@"Invalid configuration: upperLimit < lowerLimit; lowerLimit not set") + NSLog(@"Invalid configuration: upperLimit < lowerLimit; lowerLimit not set"); } else { view.lowerLimit = lowerLimit; } @@ -171,7 +171,7 @@ - (void)sliderTouchEnd:(RNCSlider *)sender float upperLimit = [RCTConvert float:json]; if (upperLimit < view.lowerLimit) { - NSLog(@"Invalid configuration: upperLimit < lowerLimit; upperLimit not set") + NSLog(@"Invalid configuration: upperLimit < lowerLimit; upperLimit not set"); } else { view.upperLimit = upperLimit; } From 356a0a9691461806b7e52b18dd4116446283d536 Mon Sep 17 00:00:00 2001 From: Bartosz Klonowski <70535775+BartoszKlonowski@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:11:20 +0200 Subject: [PATCH 5/6] Remove outdated comment --- .../main/java/com/reactnativecommunity/slider/ReactSlider.java | 1 - 1 file changed, 1 deletion(-) diff --git a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java index 7b698f0d..3e86b29f 100644 --- a/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java +++ b/package/android/src/main/java/com/reactnativecommunity/slider/ReactSlider.java @@ -246,7 +246,6 @@ private void updateLowerLimit() { } /** Update limit based on props limit, max and min - * Fallback to lower limit if invalid configuration provided */ private void updateUpperLimit() { double limit = Math.min(mRealUpperLimit, mMaxValue); From bfebb87b7a556e8ca982a778e646da341f68362f Mon Sep 17 00:00:00 2001 From: Bartosz Klonowski <70535775+BartoszKlonowski@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:11:37 +0200 Subject: [PATCH 6/6] Correct the minor typo --- package/src/Slider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/src/Slider.tsx b/package/src/Slider.tsx index 674bdbb7..71ede5a0 100644 --- a/package/src/Slider.tsx +++ b/package/src/Slider.tsx @@ -284,7 +284,7 @@ const SliderComponent = ( useEffect(() => { if (lowerLimit >= upperLimit) { console.warn( - 'Invalid configuration: lower limit is supposed to me smaller than upper limit', + 'Invalid configuration: lower limit is supposed to be smaller than upper limit', ); } }, [lowerLimit, upperLimit]);