Skip to content

Commit c71af93

Browse files
committed
fix(label): return styles and calc to prev values for platforms other than web
1 parent 900dd6e commit c71af93

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/label/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import PropTypes from 'prop-types';
22
import React, { PureComponent } from 'react';
3-
import { Animated } from 'react-native';
3+
import { Platform, Animated } from 'react-native';
44

55
import styles from './styles';
66

@@ -104,7 +104,7 @@ export default class Label extends PureComponent {
104104
}, {
105105
translateX: labelAnimation.interpolate({
106106
inputRange: [0, 1],
107-
outputRange: [x0, x1 - fontSize],
107+
outputRange: [x0, Platform.select({default: x1, web: x1 - fontSize})],
108108
}),
109109
}],
110110
};

src/components/label/styles.js

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { StyleSheet } from 'react-native';
22

33
export default StyleSheet.create({
44
container: {
5+
...Platform.select({default: {
6+
left: '-100%',
7+
width: '200%',
8+
paddingLeft: '-50%'
9+
}, web: {}}),
510
position: 'absolute',
611
top: 0,
712
},

0 commit comments

Comments
 (0)