Skip to content

Commit c3cfb31

Browse files
netshadesatya164
authored andcommitted
feat: allow Chip to expand to font size changes (#697)
### Motivation The `Chip` component had a strict height on its `Text` component, which would clip the text internally if the user had adjusted the font size of the application. ### Test plan 1. Create an app with a `Chip` component 1. Adjust your font size in the device's Accessibility settings to the largest possible font size 1. Start the app 1. Observe that the text is not clipped inside the `Chip` component
1 parent d969f02 commit c3cfb31

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/Chip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const styles = StyleSheet.create({
296296
padding: 4,
297297
},
298298
text: {
299-
height: 24,
299+
minHeight: 24,
300300
lineHeight: 24,
301301
textAlignVertical: 'center',
302302
marginVertical: 4,

src/components/__tests__/__snapshots__/Chip.test.js.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ exports[`renders chip with close button 1`] = `
9696
},
9797
Array [
9898
Object {
99-
"height": 24,
10099
"lineHeight": 24,
101100
"marginVertical": 4,
101+
"minHeight": 24,
102102
"textAlignVertical": "center",
103103
},
104104
Object {
@@ -264,9 +264,9 @@ exports[`renders chip with icon 1`] = `
264264
},
265265
Array [
266266
Object {
267-
"height": 24,
268267
"lineHeight": 24,
269268
"marginVertical": 4,
269+
"minHeight": 24,
270270
"textAlignVertical": "center",
271271
},
272272
Object {
@@ -336,9 +336,9 @@ exports[`renders chip with onPress 1`] = `
336336
},
337337
Array [
338338
Object {
339-
"height": 24,
340339
"lineHeight": 24,
341340
"marginVertical": 4,
341+
"minHeight": 24,
342342
"textAlignVertical": "center",
343343
},
344344
Object {
@@ -412,9 +412,9 @@ exports[`renders outlined disabled chip 1`] = `
412412
},
413413
Array [
414414
Object {
415-
"height": 24,
416415
"lineHeight": 24,
417416
"marginVertical": 4,
417+
"minHeight": 24,
418418
"textAlignVertical": "center",
419419
},
420420
Object {
@@ -533,9 +533,9 @@ exports[`renders selected chip 1`] = `
533533
},
534534
Array [
535535
Object {
536-
"height": 24,
537536
"lineHeight": 24,
538537
"marginVertical": 4,
538+
"minHeight": 24,
539539
"textAlignVertical": "center",
540540
},
541541
Object {

0 commit comments

Comments
 (0)