miblanchard / react-native-slider

A pure JavaScript <Slider> component for react-native and react-native-web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MinimumTrack is sometimes broken.

khj3132 opened this issue · comments

The slider's minimumTrack is sometimes broken. The minimumTrack is in a strange place, not on top of the main track. This doesn't happen all the time, just occasionally. I don't know under what circumstances this happens though. Can you tell me what the problem is?

IMG_0231
IMG_0232

react-native: 0.67.5
react-native-slider: 2.1.0

This is our slider code.

       <Slider
            minimumValue={0}
            maximumValue={MAX_VOLUME}
            step={1}
            trackClickable={true}
            thumbTouchSize={styles.sliderThumbSize}
            containerStyle={styles.slider}
            thumbStyle={styles.sliderThumb}
            trackStyle={sliderTrackStyles(volumeSliderPressed).sliderTrack}
            maximumTrackTintColor={Colors.medium_40}
            minimumTrackTintColor={
              unavailableStatus || (!volumeSliderPressed &&
                  (volumeInfo?.current === 0 || volumeInfo?.mute))
                ? Colors.medium_40
                : Colors.dark_100
            }
            value={volumeInfo?.current}
            renderTrackMarkComponent={
              volumeInfo?.max !== MAX_VOLUME
                ? renderTrackMarkComponent
                : undefined
            }
            trackMarks={(volumeInfo && [volumeInfo?.max - 0.5]) || []}
            trackRightPadding={10}
            onSlidingStart={onSlidingStart}
            onSlidingComplete={onSlidingComplete}
       />