Skip to content

Commit 1f91221

Browse files
authored
Support overriding TextField preset's fieldStyle (#1836)
1 parent 8c4d6b1 commit 1f91221

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

generatedTypes/src/incubator/TextField/usePreset.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,11 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
571571
modifiers: import("../../commons/modifiers").ExtractedStyle;
572572
forwardedRef: any;
573573
} | {
574+
fieldStyle: (import("react-native").StyleProp<import("react-native").ViewStyle> | {
575+
borderBottomWidth: number;
576+
borderBottomColor: string;
577+
paddingBottom: number;
578+
})[];
574579
margin?: boolean | undefined;
575580
marginL?: boolean | undefined;
576581
marginT?: boolean | undefined;
@@ -1196,11 +1201,6 @@ export default function usePreset({ preset, ...props }: InternalTextFieldProps):
11961201
validateOnChange?: boolean | undefined;
11971202
validateOnBlur: boolean;
11981203
onChangeValidity?: ((isValid: boolean) => void) | undefined;
1199-
fieldStyle: false | import("react-native").ViewStyle | import("react-native").RegisteredStyle<import("react-native").ViewStyle> | import("react-native").RecursiveArray<import("react-native").ViewStyle | import("react-native").Falsy | import("react-native").RegisteredStyle<import("react-native").ViewStyle>> | {
1200-
borderBottomWidth: number;
1201-
borderBottomColor: string;
1202-
paddingBottom: number;
1203-
} | null;
12041204
dynamicFieldStyle?: ((context: import("./FieldContext").FieldContextType, props: {
12051205
preset: string | null | undefined;
12061206
}) => import("react-native").StyleProp<import("react-native").ViewStyle>) | undefined;

src/incubator/TextField/textField.api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
{
5555
"name": "fieldStyle",
5656
"type": "ViewStyle | (context: FieldContextType, props) => ViewStyle",
57-
"description": "Internal style for the field container"
57+
"description": "Internal style for the field container to style the field underline, outline and fill color"
5858
},
5959
{"name": "containerStyle", "type": "ViewStyle", "description": "Container style of the whole component"},
6060
{

src/incubator/TextField/usePreset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import defaultPreset from './presets/default';
33

44
export default function usePreset({preset/* = 'default' */, ...props}: InternalTextFieldProps) {
55
if (preset === 'default') {
6-
return {...defaultPreset, ...props};
6+
return {...defaultPreset, ...props, fieldStyle: [defaultPreset.fieldStyle, props.fieldStyle]};
77
}
88
return props;
99
}

0 commit comments

Comments
 (0)