File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 6
6
* other elements (leading/trailing accessories). It usually best to set lineHeight with undefined
7
7
*/
8
8
import React , { useMemo } from 'react' ;
9
- import { omit } from 'lodash' ;
9
+ import { isEmpty , trim , omit } from 'lodash' ;
10
10
import { asBaseComponent , forwardRef } from '../../commons/new' ;
11
11
import View from '../../components/view' ;
12
12
import { Colors } from '../../style' ;
@@ -87,6 +87,7 @@ const TextField = (props: InternalTextFieldProps) => {
87
87
88
88
const fieldStyle = [ fieldStyleProp , dynamicFieldStyle ?.( context , { preset : props . preset } ) ] ;
89
89
const hidePlaceholder = shouldHidePlaceholder ( props , fieldState . isFocused ) ;
90
+ const retainTopMessageSpace = ! floatingPlaceholder && isEmpty ( trim ( label ) ) ;
90
91
91
92
return (
92
93
< FieldContext . Provider value = { context } >
@@ -106,6 +107,7 @@ const TextField = (props: InternalTextFieldProps) => {
106
107
validate = { others . validate }
107
108
validationMessage = { others . validationMessage }
108
109
validationMessageStyle = { validationMessageStyle }
110
+ retainSpace = { retainTopMessageSpace }
109
111
testID = { `${ props . testID } .validationMessage` }
110
112
/>
111
113
) }
You can’t perform that action at this time.
0 commit comments