@@ -669,7 +669,9 @@ const TextInput = createReactClass({
669
669
670
670
render : function ( ) {
671
671
if ( Platform . OS === 'ios' ) {
672
- return this . _renderIOS ( ) ;
672
+ return UIManager . RCTVirtualText
673
+ ? this . _renderIOS ( )
674
+ : this . _renderIOSLegacy ( ) ;
673
675
} else if ( Platform . OS === 'android' ) {
674
676
return this . _renderAndroid ( ) ;
675
677
}
@@ -687,7 +689,7 @@ const TextInput = createReactClass({
687
689
this . _inputRef = ref ;
688
690
} ,
689
691
690
- _renderIOS : function ( ) {
692
+ _renderIOSLegacy : function ( ) {
691
693
var textContainer ;
692
694
693
695
var props = Object . assign ( { } , this . props ) ;
@@ -778,6 +780,57 @@ const TextInput = createReactClass({
778
780
) ;
779
781
} ,
780
782
783
+ _renderIOS : function ( ) {
784
+ var props = Object . assign ( { } , this . props ) ;
785
+ props . style = [ this . props . style ] ;
786
+
787
+ if ( props . selection && props . selection . end == null ) {
788
+ props . selection = {
789
+ start : props . selection . start ,
790
+ end : props . selection . start ,
791
+ } ;
792
+ }
793
+
794
+ const RCTTextInputView = props . multiline
795
+ ? RCTMultilineTextInputView
796
+ : RCTSinglelineTextInputView ;
797
+
798
+ if ( props . multiline ) {
799
+ props . style . unshift ( styles . multilineInput ) ;
800
+ }
801
+
802
+ const textContainer = (
803
+ < RCTTextInputView
804
+ ref = { this . _setNativeRef }
805
+ { ...props }
806
+ onFocus = { this . _onFocus }
807
+ onBlur = { this . _onBlur }
808
+ onChange = { this . _onChange }
809
+ onContentSizeChange = { this . props . onContentSizeChange }
810
+ onSelectionChange = { this . _onSelectionChange }
811
+ onTextInput = { this . _onTextInput }
812
+ onSelectionChangeShouldSetResponder = { emptyFunction . thatReturnsTrue }
813
+ text = { this . _getText ( ) }
814
+ dataDetectorTypes = { this . props . dataDetectorTypes }
815
+ onScroll = { this . _onScroll }
816
+ />
817
+ ) ;
818
+
819
+ return (
820
+ < TouchableWithoutFeedback
821
+ onLayout = { props . onLayout }
822
+ onPress = { this . _onPress }
823
+ rejectResponderTermination = { true }
824
+ accessible = { props . accessible }
825
+ accessibilityLabel = { props . accessibilityLabel }
826
+ accessibilityTraits = { props . accessibilityTraits }
827
+ nativeID = { this . props . nativeID }
828
+ testID = { props . testID } >
829
+ { textContainer }
830
+ </ TouchableWithoutFeedback >
831
+ ) ;
832
+ } ,
833
+
781
834
_renderAndroid : function ( ) {
782
835
const props = Object . assign ( { } , this . props ) ;
783
836
props . style = [ this . props . style ] ;
0 commit comments