Skip to content

Commit 02bad35

Browse files
committed
TextField: forward containerId prop
1 parent c3b931f commit 02bad35

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/components/switch/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export type SwitchProps = {
5656
thumbStyle?: StyleProp<ViewStyle>;
5757
style?: StyleProp<ViewStyle>;
5858
testID?: string;
59+
id?: string;
5960
}
6061

6162
/**

src/incubator/TextField/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const TextField = (props: InternalTextFieldProps) => {
4646
const {
4747
modifiers,
4848
// General
49+
containerId,
4950
fieldStyle: fieldStyleProp,
5051
dynamicFieldStyle,
5152
containerStyle,
@@ -123,7 +124,7 @@ const TextField = (props: InternalTextFieldProps) => {
123124

124125
return (
125126
<FieldContext.Provider value={context}>
126-
<View style={[margins, positionStyle, containerStyle, centeredContainerStyle]}>
127+
<View id={containerId} style={[margins, positionStyle, containerStyle, centeredContainerStyle]}>
127128
<Label
128129
label={label}
129130
labelColor={labelColor}

src/incubator/TextField/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export type TextFieldProps = MarginModifiers &
164164
// FieldStateProps &
165165
ValidationMessageProps &
166166
Omit<CharCounterProps, 'maxLength' | 'testID'> & {
167+
/**
168+
* Pass id to the container
169+
*/
170+
containerId?: string;
167171
/**
168172
* Pass to render a leading element
169173
*/

0 commit comments

Comments
 (0)