File tree 1 file changed +13
-1
lines changed
Libraries/Components/TextInput
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -815,6 +815,7 @@ const TextInput = createReactClass({
815
815
_inputRef : ( undefined : any ) ,
816
816
_focusSubscription : ( undefined : ?Function ) ,
817
817
_lastNativeText : ( undefined : ?string ) ,
818
+ _initialDefaultValue : ( undefined : ?string ) ,
818
819
_lastNativeSelection : ( undefined : ?Selection ) ,
819
820
820
821
componentDidMount : function ( ) {
@@ -893,6 +894,17 @@ const TextInput = createReactClass({
893
894
: '' ;
894
895
} ,
895
896
897
+ _getTextDesktop : function ( ) : ?string {
898
+ if ( ! this . _initialDefaultValue && typeof this . props . defaultValue === 'string' ) {
899
+ this . _initialDefaultValue = this . props . defaultValue ;
900
+ }
901
+ return typeof this . props . value === 'string'
902
+ ? this . props . value
903
+ : typeof this . _initialDefaultValue === 'string'
904
+ ? this . _initialDefaultValue
905
+ : '' ;
906
+ } ,
907
+
896
908
_setNativeRef : function ( ref : any ) {
897
909
this . _inputRef = ref ;
898
910
} ,
@@ -1112,7 +1124,7 @@ const TextInput = createReactClass({
1112
1124
onBlur = { this . _onBlur }
1113
1125
onChange = { this . _onChange }
1114
1126
onSelectionChangeShouldSetResponder = { ( ) => true }
1115
- text = { this . _getText ( ) }
1127
+ text = { this . _getTextDesktop ( ) }
1116
1128
/>
1117
1129
)
1118
1130
} ,
You can’t perform that action at this time.
0 commit comments