File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,13 @@ const Label = ({
19
19
validationMessagePosition,
20
20
floatingPlaceholder,
21
21
showMandatoryIndication,
22
+ enableErrors,
22
23
testID
23
24
} : LabelProps ) => {
24
25
const context = useContext ( FieldContext ) ;
25
26
26
- const forceHidingLabel = ! context . isValid && validationMessagePosition === ValidationMessagePosition . TOP ;
27
+ const forceHidingLabel =
28
+ enableErrors && ! context . isValid && validationMessagePosition === ValidationMessagePosition . TOP ;
27
29
28
30
const style = useMemo ( ( ) => {
29
31
return [ styles . label , labelStyle , floatingPlaceholder && styles . dummyPlaceholder ] ;
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ const TextField = (props: InternalTextFieldProps) => {
139
139
validationMessagePosition = { validationMessagePosition }
140
140
testID = { `${ props . testID } .label` }
141
141
showMandatoryIndication = { showMandatoryIndication }
142
+ enableErrors = { enableErrors }
142
143
/>
143
144
{ validationMessagePosition === ValidationMessagePosition . TOP && (
144
145
< ValidationMessage
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export interface MandatoryIndication {
61
61
showMandatoryIndication ?: boolean ;
62
62
}
63
63
64
- export interface LabelProps extends MandatoryIndication {
64
+ export interface LabelProps extends MandatoryIndication , Pick < ValidationMessageProps , 'enableErrors' > {
65
65
/**
66
66
* Field label
67
67
*/
You can’t perform that action at this time.
0 commit comments