@@ -126,42 +126,19 @@ const TextField = (props: InternalTextFieldProps) => {
126
126
return [ inputStyle , styles . dummyPlaceholder ] ;
127
127
} , [ inputStyle ] ) ;
128
128
129
- let textFieldLabel = (
130
- < Label
131
- label = { label }
132
- labelColor = { labelColor }
133
- labelStyle = { _labelStyle }
134
- labelProps = { labelProps }
135
- floatingPlaceholder = { floatingPlaceholder }
136
- validationMessagePosition = { validationMessagePosition }
137
- testID = { `${ props . testID } .label` }
138
- />
139
- ) ;
140
- const textFieldIsRequired =
141
- ( typeof others . validate === 'string' && others . validate === 'required' ) ||
142
- ( Array . isArray ( others . validate ) && others . validate . includes ( 'required' ) ) ;
143
-
144
- if ( showMandatoryIndication && textFieldIsRequired ) {
145
- textFieldLabel = (
146
- < View row >
147
- { textFieldLabel }
129
+ return (
130
+ < FieldContext . Provider value = { context } >
131
+ < View { ...containerProps } style = { [ margins , positionStyle , containerStyle , centeredContainerStyle ] } >
148
132
< Label
149
- label = { '*' }
150
- labelColor = { Colors . red30 } // TODO: Decide how and which color should be here.
133
+ label = { label }
134
+ labelColor = { labelColor }
151
135
labelStyle = { _labelStyle }
152
136
labelProps = { labelProps }
153
137
floatingPlaceholder = { floatingPlaceholder }
154
138
validationMessagePosition = { validationMessagePosition }
155
- testID = { `${ props . testID } .label.mandatory` }
139
+ testID = { `${ props . testID } .label` }
140
+ showMandatoryIndication = { showMandatoryIndication }
156
141
/>
157
- </ View >
158
- ) ;
159
- }
160
-
161
- return (
162
- < FieldContext . Provider value = { context } >
163
- < View { ...containerProps } style = { [ margins , positionStyle , containerStyle , centeredContainerStyle ] } >
164
- { textFieldLabel }
165
142
{ validationMessagePosition === ValidationMessagePosition . TOP && (
166
143
< ValidationMessage
167
144
enableErrors = { enableErrors }
0 commit comments