From 5fb92da31727fb448cfd34b80e13e4f20ae3bfcc Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Tue, 20 Feb 2018 16:44:38 -0800 Subject: [PATCH] [fix] Switch layout when left/right do not flip The I18nManager can now disable the automatic BiDi flipping of left/right, which caused the Switch layout to break in RTL mode. Change the styles to use start/end. --- packages/react-native-web/src/exports/Switch/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-web/src/exports/Switch/index.js b/packages/react-native-web/src/exports/Switch/index.js index b2cfa553..dc557bc3 100644 --- a/packages/react-native-web/src/exports/Switch/index.js +++ b/packages/react-native-web/src/exports/Switch/index.js @@ -135,7 +135,7 @@ class Switch extends Component<*> { thumbStyle, value && styles.thumbOn, { - marginLeft: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0 + marginStart: value ? multiplyStyleLengthValue(thumbWidth, -1) : 0 } ]} /> @@ -191,12 +191,12 @@ const styles = StyleSheet.create({ alignSelf: 'flex-start', borderRadius: '100%', boxShadow: thumbDefaultBoxShadow, - left: '0%', + start: '0%', transform: [{ translateZ: 0 }], transitionDuration: '0.1s' }, thumbOn: { - left: '100%' + start: '100%' }, disabledThumb: { backgroundColor: '#BDBDBD'