react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

Vertical Orientation does not work!

Open AakashKB opened this issue 6 years ago • 7 comments

Vertical orientation does not work. I still have to transform it be 90 degrees and when I do, the slider does animate properly. Inverted does not work while doing this either. Here is my code:

<Slider
                    style={{flex:1,backgroundColor:"pink",transform: [{ rotate: '90deg'}]}}
                    trackStyle={{height:10,width:200}}
                    value={this.state.strokeWidth}
                    onValueChange={value=>this.setState({strokeWidth:value})}
                    orientation="vertical"
                    inverted={true}
                    minimumValue={1}
                    maximumValue={20}
                    step={2}
                    onSlidingComplete={value=>alert(value)}
/>

AakashKB avatar Mar 07 '18 18:03 AakashKB

try orientation={'vertical'}

timorss avatar Mar 11 '18 09:03 timorss

Same issue here. Moreover Im not even was able to manage value correctly in rotated state(without rotation it is working fine). <Slider style={{ width: 270, marginHorizontal: 15, transform:[{ rotate(-90deg)}] }} value={moodValue} invert orientation={'vertical'} onValueChange={this.handleMoodValueChange} maximumValue={11} minimumValue={0} step={1} thumbStyle={{backgroundColor: 'green', borderColor: '#8134f8', borderWidth: 3 }} thumbTouchSize={{width: 60, height: 60}} minimumTrackTintColor={'#f60'} /> However I solved the problem with Slider from react-native-elements with the same props. P.S. Still figuring out how to invert it though))

olekspickle avatar May 04 '18 11:05 olekspickle

I had the same problem,when this component is rotated, can't slide properly.Here is my code <View style={{transform: [{rotateZ:'-90deg'}]}}> <RNSlider style={styles.slider} trackStyle={styles.track} thumbStyle={styles.thumb} minimumTrackTintColor='#da282e'/> </View>

YoussiaTang avatar Jun 06 '18 08:06 YoussiaTang

I also have same issue. Please provide a solution for this. Slider does not work with 'transform: [{ rotate: '-90deg' }]' style.

ajaykumar97 avatar Aug 21 '18 07:08 ajaykumar97

same issue here if i use rotation then it's UI distorts, height and width not working properly

AnandKumar1100 avatar Oct 28 '18 15:10 AnandKumar1100

same issue as well. orientation={'vertical'} or orientation='vertical' does not work. Transform works visually, but the slider no longer moves when clicked.

shanekoss avatar Dec 07 '18 12:12 shanekoss

this fork: https://github.com/emmanuellmota/react-native-slider handles vertical sliders. Pass in vertical as a prop. You still have to handle all the transforms yourself, but moving up and down worked for me in simulator.

TimmeeG avatar Mar 29 '19 14:03 TimmeeG