mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
[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.
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user