@@ -219,13 +219,6 @@ const TextInput = createReactClass({
219
219
* The default value is `false`.
220
220
*/
221
221
autoFocus : PropTypes . bool ,
222
- /**
223
- * If true, will increase the height of the textbox if need be. If false,
224
- * the textbox will become scrollable once the height is reached. The
225
- * default value is false.
226
- * @platform android
227
- */
228
- autoGrow : PropTypes . bool ,
229
222
/**
230
223
* Specifies whether fonts should scale to respect Text Size accessibility settings. The
231
224
* default is `true`.
@@ -351,11 +344,6 @@ const TextInput = createReactClass({
351
344
* instead of implementing the logic in JS to avoid flicker.
352
345
*/
353
346
maxLength : PropTypes . number ,
354
- /**
355
- * If autogrow is `true`, limits the height that the TextInput box can grow
356
- * to. Once it reaches this height, the TextInput becomes scrollable.
357
- */
358
- maxHeight : PropTypes . number ,
359
347
/**
360
348
* Sets the number of lines for a `TextInput`. Use it with multiline set to
361
349
* `true` to be able to fill the lines.
@@ -612,10 +600,6 @@ const TextInput = createReactClass({
612
600
*/
613
601
mixins : [ NativeMethodsMixin , TimerMixin ] ,
614
602
615
- getInitialState : function ( ) {
616
- return { layoutHeight : this . _layoutHeight } ;
617
- } ,
618
-
619
603
/**
620
604
* Returns `true` if the input is currently focused; `false` otherwise.
621
605
*/
@@ -633,7 +617,6 @@ const TextInput = createReactClass({
633
617
_focusSubscription : ( undefined : ?Function ) ,
634
618
_lastNativeText : ( undefined : ?string ) ,
635
619
_lastNativeSelection : ( undefined : ?Selection ) ,
636
- _layoutHeight : ( - 1 : number ) ,
637
620
638
621
componentDidMount : function ( ) {
639
622
this . _lastNativeText = this . props . value ;
@@ -766,6 +749,7 @@ const TextInput = createReactClass({
766
749
onScroll = { this . _onScroll }
767
750
/> ;
768
751
}
752
+
769
753
return (
770
754
< TouchableWithoutFeedback
771
755
onLayout = { props . onLayout }
@@ -783,10 +767,7 @@ const TextInput = createReactClass({
783
767
784
768
_renderAndroid : function ( ) {
785
769
const props = Object . assign ( { } , this . props ) ;
786
- props . style = this . props . style ;
787
- if ( this . state . layoutHeight >= 0 ) {
788
- props . style = [ props . style , { height : this . state . layoutHeight } ] ;
789
- }
770
+ props . style = [ this . props . style ] ;
790
771
props . autoCapitalize =
791
772
UIManager . AndroidTextInput . Constants . AutoCapitalizationType [
792
773
props . autoCapitalize || 'sentences'
@@ -804,9 +785,11 @@ const TextInput = createReactClass({
804
785
if ( childCount > 1 ) {
805
786
children = < Text > { children } </ Text > ;
806
787
}
788
+
807
789
if ( props . selection && props . selection . end == null ) {
808
790
props . selection = { start : props . selection . start , end : props . selection . start } ;
809
791
}
792
+
810
793
const textContainer =
811
794
< AndroidTextInput
812
795
ref = { this . _setNativeRef }
@@ -815,7 +798,6 @@ const TextInput = createReactClass({
815
798
onFocus = { this . _onFocus }
816
799
onBlur = { this . _onBlur }
817
800
onChange = { this . _onChange }
818
- onContentSizeChange = { this . _onContentSizeChange }
819
801
onSelectionChange = { this . _onSelectionChange }
820
802
onTextInput = { this . _onTextInput }
821
803
text = { this . _getText ( ) }
@@ -878,26 +860,6 @@ const TextInput = createReactClass({
878
860
this . forceUpdate ( ) ;
879
861
} ,
880
862
881
- _onContentSizeChange : function ( event : Event ) {
882
- let contentHeight = event . nativeEvent . contentSize . height ;
883
- if ( this . props . autoGrow ) {
884
- if ( this . props . maxHeight ) {
885
- contentHeight = Math . min ( this . props . maxHeight , contentHeight ) ;
886
- }
887
- this . setState ( { layoutHeight : Math . max ( this . _layoutHeight , contentHeight ) } ) ;
888
- }
889
-
890
- this . props . onContentSizeChange && this . props . onContentSizeChange ( event ) ;
891
- } ,
892
-
893
- _onLayout : function ( event : Event ) {
894
- const height = event . nativeEvent . layout . height ;
895
- if ( height ) {
896
- this . _layoutHeight = event . nativeEvent . layout . height ;
897
- }
898
- this . props . onLayout && this . props . onLayout ( event ) ;
899
- } ,
900
-
901
863
_onSelectionChange : function ( event : Event ) {
902
864
this . props . onSelectionChange && this . props . onSelectionChange ( event ) ;
903
865
0 commit comments