Skip to content

Commit

Permalink
Fix bug with double thumb background color (miblanchard#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfreeman28 authored Sep 6, 2023
1 parent 5e16c6c commit 516c820
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ export class Slider extends PureComponent<SliderProps, SliderState> {
const minTrackWidth = _startFromZero
? Math.abs(_value) * sliderWidthCoefficient - thumbSize.width / 2
: interpolatedTrackValues[0];
const maxTrackWidth = interpolatedTrackValues[1];
const clearBorderRadius = {} as ViewStyle;
if (_startFromZero && _value < 0 + step) {
clearBorderRadius.borderBottomRightRadius = 0;
Expand All @@ -716,14 +717,11 @@ export class Slider extends PureComponent<SliderProps, SliderState> {
left:
interpolatedTrackValues.length === 1
? new Animated.Value(startPositionOnTrack)
: Animated.add(minThumbValue, thumbSize.width / 2),
: Animated.add(minTrackWidth, thumbSize.width / 2),
width:
interpolatedTrackValues.length === 1
? Animated.add(minTrackWidth, thumbSize.width / 2)
: Animated.add(
Animated.multiply(minThumbValue, -1),
maxThumbValue,
),
: Animated.add(Animated.multiply(minTrackWidth, -1), maxTrackWidth),
backgroundColor: minimumTrackTintColor,
...valueVisibleStyle,
...clearBorderRadius,
Expand Down

0 comments on commit 516c820

Please sign in to comment.