Skip to content

Commit c30c925

Browse files
authored
fix: correct text position in CheckboxItem, update snapshots (#2749)
1 parent 8f95915 commit c30c925

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/components/Checkbox/CheckboxItem.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,16 @@ const CheckboxItem = ({
114114
<TouchableRipple onPress={onPress} testID={testID}>
115115
<View style={[styles.container, style]} pointerEvents="none">
116116
{isLeading && checkbox}
117-
<Text style={[styles.label, { color: theme.colors.text }, labelStyle]}>
117+
<Text
118+
style={[
119+
styles.label,
120+
{
121+
color: theme.colors.text,
122+
textAlign: isLeading ? 'right' : 'left',
123+
},
124+
labelStyle,
125+
]}
126+
>
118127
{label}
119128
</Text>
120129
{!isLeading && checkbox}

src/components/__tests__/Checkbox/__snapshots__/CheckboxItem.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ exports[`can render leading checkbox control 1`] = `
127127
},
128128
Object {
129129
"color": "#000000",
130+
"textAlign": "right",
130131
},
131132
undefined,
132133
],
@@ -191,6 +192,7 @@ exports[`can render the Android checkbox on different platforms 1`] = `
191192
},
192193
Object {
193194
"color": "#000000",
195+
"textAlign": "left",
194196
},
195197
undefined,
196198
],
@@ -364,6 +366,7 @@ exports[`can render the iOS checkbox on different platforms 1`] = `
364366
},
365367
Object {
366368
"color": "#000000",
369+
"textAlign": "left",
367370
},
368371
undefined,
369372
],
@@ -503,6 +506,7 @@ exports[`renders unchecked 1`] = `
503506
},
504507
Object {
505508
"color": "#000000",
509+
"textAlign": "left",
506510
},
507511
undefined,
508512
],

src/components/__tests__/RadioButton/__snapshots__/RadioButtonItem.test.js.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ exports[`can render leading radio button control 1`] = `
121121
},
122122
Array [
123123
Object {
124-
"flex": 1,
124+
"flexGrow": 1,
125+
"flexShrink": 1,
125126
"fontSize": 16,
126127
},
127128
Object {

0 commit comments

Comments
 (0)