Skip to content

Commit d776129

Browse files
committed
Fix text refusing to wrap to make space for other elements.
1 parent bd9d6af commit d776129

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

react-native/components/createTextComponent/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const createTextComponent = (
3333
lineHeight: fontSize * 1.4,
3434
color,
3535
textAlign: alignment,
36+
flexShrink: 1,
3637
},
3738
});
3839

react-native/components/createTextComponent/unit.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ test(`renders single-line`, () => {
2222
lineHeight: 51.8,
2323
color: `#34AE17`,
2424
textAlign: `left`,
25+
flexShrink: 1,
2526
}}
2627
numberOfLines={1}
2728
>
@@ -49,6 +50,7 @@ test(`renders multi-line`, () => {
4950
lineHeight: 51.8,
5051
color: `#34AE17`,
5152
textAlign: `left`,
53+
flexShrink: 1,
5254
}}
5355
numberOfLines={0}
5456
>
@@ -76,6 +78,7 @@ test(`renders with onPress undefined`, () => {
7678
lineHeight: 51.8,
7779
color: `#34AE17`,
7880
textAlign: `left`,
81+
flexShrink: 1,
7982
}}
8083
numberOfLines={1}
8184
>
@@ -104,6 +107,7 @@ test(`renders with onPress set`, () => {
104107
lineHeight: 51.8,
105108
color: `#34AE17`,
106109
textAlign: `left`,
110+
flexShrink: 1,
107111
}}
108112
numberOfLines={1}
109113
onPress={expect.any(Function)}

0 commit comments

Comments
 (0)