mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-29 12:54:53 +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,
|
thumbStyle,
|
||||||
value && styles.thumbOn,
|
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',
|
alignSelf: 'flex-start',
|
||||||
borderRadius: '100%',
|
borderRadius: '100%',
|
||||||
boxShadow: thumbDefaultBoxShadow,
|
boxShadow: thumbDefaultBoxShadow,
|
||||||
left: '0%',
|
start: '0%',
|
||||||
transform: [{ translateZ: 0 }],
|
transform: [{ translateZ: 0 }],
|
||||||
transitionDuration: '0.1s'
|
transitionDuration: '0.1s'
|
||||||
},
|
},
|
||||||
thumbOn: {
|
thumbOn: {
|
||||||
left: '100%'
|
start: '100%'
|
||||||
},
|
},
|
||||||
disabledThumb: {
|
disabledThumb: {
|
||||||
backgroundColor: '#BDBDBD'
|
backgroundColor: '#BDBDBD'
|
||||||
|
|||||||
Reference in New Issue
Block a user