Skip to content

Commit d7c107d

Browse files
committed
fix: only mirror switch on iOS
1 parent 13214a7 commit d7c107d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
import { I18nManager, ViewStyle } from 'react-native';
1+
import { I18nManager, Platform, ViewStyle } from 'react-native';
22

3-
/** Mirrors Switch horizontally in RTL so thumb/track match layout direction. */
3+
/** Mirrors Switch horizontally in RTL on iOS so thumb/track match layout direction. */
44
export function getRtlMirrorSwitchStyle(): Pick<ViewStyle, 'transform'> {
5+
if (Platform.OS !== 'ios' || !I18nManager.isRTL) {
6+
return {};
7+
}
58
return {
6-
transform: [{ scaleX: I18nManager.isRTL ? -1 : 1 }],
9+
transform: [{ scaleX: -1 }],
710
};
811
}

0 commit comments

Comments
 (0)