React-native-slider: RTL Support

Created on 17 Apr 2019  路  3Comments  路  Source: callstack/react-native-slider

Describe the Feature

The slider works but in LTR on RTL forced apps. It would be great to support RTL.

feature request

Most helpful comment

If you'd like to have this functionality supported out of the box, please consider sending a PR. As for now, you can use this workaround:

import { I18nManager } from 'react-native';
...
<Slider inverted={I18nManager.isRTL} />

All 3 comments

try this:

import { I18nManager } from 'react-native';
const styles = StyleSheet.create({
    ttb: { transform: [{ rotate: '90deg' }] },
    btt: { transform: [{ rotate: '-90deg' }] },
    rtl: { transform: [{ scale: -1 }] },
    auto: I18nManager.isRTL ? { transform: [{ scale: -1 }] } : {},
    sliderContainer: {
        flex: 1,
        justifyContent: "center"
    },
});


<View style={[styles.auto, styles.sliderContainer]}><Slider /></View>

If you'd like to have this functionality supported out of the box, please consider sending a PR. As for now, you can use this workaround:

import { I18nManager } from 'react-native';
...
<Slider inverted={I18nManager.isRTL} />

The inverted prop didn't work for me.
I added style={{direction:"ltr"}} to the Slider component but ot works only for ios.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

canyavall picture canyavall  路  5Comments

gdoudeng picture gdoudeng  路  5Comments

CHaNGeTe picture CHaNGeTe  路  11Comments

javadi69 picture javadi69  路  4Comments

JustynaKK picture JustynaKK  路  8Comments