Skip to content

Unable to add a thumbImage without having a StepMarker #711

Open
@liestig

Description

@liestig

Environment

  • react-native info output:
// react-native info
Expo v53
  • are you using the new architecture?
    yes

  • which version of react & react-native are you using?
    React 19 and React Native v0.79.2

Description

I am trying to put a thumbImage on my slider, however when I do so it don't work until I add a StepMarker. If I take off the StepMarker, the thumbImage will also be gone. I tried it on simulation iphone 16 with iOS 18.2 and with my iPhone 16 in real life also. I didn't find any examples with a Slider without StepMarker but with image.

Also, that's another problem, but when adding a custom thumbImage, the image is not at the exact same position as the custom thumb. I had to add a h-5 to get it down to normal position.

Reproducible Demo

Just create a Slider with a thumbImage and a StepMarker, then without StepMarker. The image should disappear and be replaced by default thumb.

<Slider
          minimumValue={0}
          maximumValue={100}
          step={5}
          value={value}
          onValueChange={handleChange}
          minimumTrackTintColor="#62A6E433"
          maximumTrackTintColor="#62A6E433"
          StepMarker={(): ReactElement => <View style={tw`h-5`}></View>}
          thumbTintColor={'#62A6E4'}
          thumbImage={require('@src/assets/images/SliderThumb.png') as ImageURISource}
        />
<Slider
          minimumValue={0}
          maximumValue={100}
          step={5}
          value={value}
          onValueChange={handleChange}
          minimumTrackTintColor="#62A6E433"
          maximumTrackTintColor="#62A6E433"
          // StepMarker={(): ReactElement => <View style={tw`h-5`}></View>}
          thumbTintColor={'#62A6E4'}
          thumbImage={require('@src/assets/images/SliderThumb.png') as ImageURISource}
        />

Metadata

Metadata

Labels

bug reportSomething isn't working

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions