Skip to content

Commit 950cb64

Browse files
authored
Fix how we render TextField children (#2369)
1 parent 766f43c commit 950cb64

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/components/picker/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const Picker = React.forwardRef((props: PickerProps, ref) => {
248248
);
249249
} else if (fieldType === PickerFieldTypes.settings) {
250250
return (
251-
<View row spread>
251+
<View flex row spread>
252252
<Text text70 style={labelStyle}>
253253
{others.label}
254254
</Text>

src/incubator/TextField/index.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const TextField = (props: InternalTextFieldProps) => {
130130
<View style={[paddings, fieldStyle]} row centerV centerH={centered}>
131131
{/* <View row centerV> */}
132132
{leadingAccessoryClone}
133-
<View flex={!centered} flexG={centered} /* flex row */>
133+
{children || <View flex={!centered} flexG={centered} /* flex row */>
134134
{floatingPlaceholder && (
135135
<FloatingPlaceholder
136136
placeholder={placeholder}
@@ -142,19 +142,17 @@ const TextField = (props: InternalTextFieldProps) => {
142142
testID={`${props.testID}.floatingPlaceholder`}
143143
/>
144144
)}
145-
{children || (
146-
<Input
147-
placeholderTextColor={hidePlaceholder ? 'transparent' : placeholderTextColor}
148-
{...others}
149-
style={[typographyStyle, colorStyle, others.style]}
150-
onFocus={onFocus}
151-
onBlur={onBlur}
152-
onChangeText={onChangeText}
153-
placeholder={placeholder}
154-
hint={hint}
155-
/>
156-
)}
157-
</View>
145+
<Input
146+
placeholderTextColor={hidePlaceholder ? 'transparent' : placeholderTextColor}
147+
{...others}
148+
style={[typographyStyle, colorStyle, others.style]}
149+
onFocus={onFocus}
150+
onBlur={onBlur}
151+
onChangeText={onChangeText}
152+
placeholder={placeholder}
153+
hint={hint}
154+
/>
155+
</View>}
158156
{trailingAccessory}
159157
{/* </View> */}
160158
</View>

0 commit comments

Comments
 (0)