@@ -184,10 +184,10 @@ class TextInput extends React.Component<TextInputProps, State> {
184184 }
185185
186186 state = {
187- labeled : new Animated . Value ( this . props . value || this . props . error ? 0 : 1 ) ,
187+ labeled : new Animated . Value ( this . props . value ? 0 : 1 ) ,
188188 error : new Animated . Value ( this . props . error ? 1 : 0 ) ,
189189 focused : false ,
190- placeholder : this . props . error ? this . props . placeholder : '' ,
190+ placeholder : '' ,
191191 value : this . props . value || this . props . defaultValue ,
192192 labelLayout : {
193193 measured : false ,
@@ -202,27 +202,25 @@ class TextInput extends React.Component<TextInputProps, State> {
202202 if (
203203 prevState . focused !== this . state . focused ||
204204 prevState . value !== this . state . value ||
205- prevProps . error !== this . props . error ||
206205 this . props . defaultValue
207206 ) {
208207 // The label should be minimized if the text input is focused, or has text
209208 // In minimized mode, the label moves up and becomes small
210- if ( this . state . value || this . state . focused || this . props . error ) {
211- this . minmizeLabel ( ) ;
209+ if ( this . state . value || this . state . focused ) {
210+ this . minimizeLabel ( ) ;
212211 } else {
213212 this . restoreLabel ( ) ;
214213 }
215214 }
216215
217216 if (
218217 prevState . focused !== this . state . focused ||
219- prevProps . label !== this . props . label ||
220- prevProps . error !== this . props . error
218+ prevProps . label !== this . props . label
221219 ) {
222- // Show placeholder text only if the input is focused, or has error, or there's no label
220+ // Show placeholder text only if the input is focused, or there's no label
223221 // We don't show placeholder if there's a label because the label acts as placeholder
224222 // When focused, the label moves up, so we can show a placeholder
225- if ( this . state . focused || this . props . error || ! this . props . label ) {
223+ if ( this . state . focused || ! this . props . label ) {
226224 this . showPlaceholder ( ) ;
227225 } else {
228226 this . hidePlaceholder ( ) ;
@@ -305,7 +303,7 @@ class TextInput extends React.Component<TextInputProps, State> {
305303 } ) ,
306304 } ) . start ( ) ;
307305
308- private minmizeLabel = ( ) =>
306+ private minimizeLabel = ( ) =>
309307 Animated . timing ( this . state . labeled , {
310308 toValue : 0 ,
311309 duration : BLUR_ANIMATION_DURATION ,
0 commit comments