mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-03 10:46:19 +00:00
committed by
Nicolas Gallagher
parent
213b616b3c
commit
617b438530
@@ -99,6 +99,12 @@ describe('StyleSheet/preprocess', () => {
|
|||||||
expect(preprocess({ aspectRatio: 9 / 16 })).toEqual({
|
expect(preprocess({ aspectRatio: 9 / 16 })).toEqual({
|
||||||
aspectRatio: '0.5625'
|
aspectRatio: '0.5625'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
expect(preprocess({ aspectRatio: '0.5' })).toEqual({
|
||||||
|
aspectRatio: '0.5'
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(preprocess({ aspectRatio: undefined })).toEqual({});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('fontVariant', () => {
|
test('fontVariant', () => {
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export const preprocess = <T: {| [key: string]: any |}>(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prop === 'aspectRatio') {
|
if (prop === 'aspectRatio' && typeof value === 'number') {
|
||||||
nextStyle[prop] = value.toString();
|
nextStyle[prop] = value.toString();
|
||||||
} else if (prop === 'fontVariant') {
|
} else if (prop === 'fontVariant') {
|
||||||
if (Array.isArray(value) && value.length > 0) {
|
if (Array.isArray(value) && value.length > 0) {
|
||||||
|
|||||||
+1
-1
@@ -188,7 +188,7 @@ export type LayoutStyles = {|
|
|||||||
| 'flex-start'
|
| 'flex-start'
|
||||||
| 'stretch'
|
| 'stretch'
|
||||||
),
|
),
|
||||||
aspectRatio?: ?number,
|
aspectRatio?: ?NumberOrString,
|
||||||
backfaceVisibility?: ?VisiblilityValue,
|
backfaceVisibility?: ?VisiblilityValue,
|
||||||
borderWidth?: ?DimensionValue,
|
borderWidth?: ?DimensionValue,
|
||||||
borderBlockWidth?: ?DimensionValue,
|
borderBlockWidth?: ?DimensionValue,
|
||||||
|
|||||||
Reference in New Issue
Block a user