@@ -28,7 +28,7 @@ var FloatingLabel = React.createClass({
2828 getInitialState ( ) {
2929 var state = {
3030 text : this . props . value ,
31- dirty : ! ! this . props . value
31+ dirty : ( this . props . value || this . props . placeholder )
3232 } ;
3333
3434 var style = state . dirty ? dirtyStyle : cleanStyle
@@ -123,20 +123,22 @@ var FloatingLabel = React.createClass({
123123 enablesReturnKeyAutomatically : this . props . enablesReturnKeyAutomatically ,
124124 keyboardType : this . props . keyboardType ,
125125 multiline : this . props . multiline ,
126+ numberOfLines : this . props . numberOfLines ,
126127 onBlur : this . _onBlur ,
127128 onChange : this . props . onChange ,
128129 onChangeText : this . onChangeText ,
129130 onEndEditing : this . updateText ,
130131 onFocus : this . _onFocus ,
131132 onSubmitEditing : this . props . onSubmitEditing ,
132133 password : this . props . secureTextEntry || this . props . password , // Compatibility
134+ placeholder : this . props . placeholder ,
133135 secureTextEntry : this . props . secureTextEntry || this . props . password , // Compatibility
134136 returnKeyType : this . props . returnKeyType ,
135137 selectTextOnFocus : this . props . selectTextOnFocus ,
136138 selectionState : this . props . selectionState ,
137139 style : [ styles . input ] ,
138140 testID : this . props . testID ,
139- value : this . props . value ,
141+ value : this . state . text ,
140142 underlineColorAndroid : this . props . underlineColorAndroid , // android TextInput will show the default bottom border
141143 onKeyPress : this . props . onKeyPress
142144 } ,
0 commit comments