From 15bf2c57b8d37d5588aca362266fd4bd45547c53 Mon Sep 17 00:00:00 2001 From: yueshuaijie Date: Sun, 31 Jul 2016 14:20:13 -0700 Subject: [PATCH] Add TextInput.dataDetectorTypes prop. Summary: On iOS, if `TextInput` is used with prop `multiline={true}`, the backend view is `UITextView`. Sometimes we need `UITextView.dataDetectorTypes` to detect clickable url in the text view. The PR add this prop to `TextInput`, so we can use it like this: `` Similar as #8743 . Closes https://github.com/facebook/react-native/pull/8863 Differential Revision: D3648027 fbshipit-source-id: 987bd4f46fb5be74099b62988135a32115d9269c --- .../UIExplorer/js/TextInputExample.ios.js | 7 ++++ Libraries/Components/TextInput/TextInput.js | 33 +++++++++++++++++++ Libraries/Text/RCTTextViewManager.m | 1 + 3 files changed, 41 insertions(+) diff --git a/Examples/UIExplorer/js/TextInputExample.ios.js b/Examples/UIExplorer/js/TextInputExample.ios.js index 6b4874465..a845df091 100644 --- a/Examples/UIExplorer/js/TextInputExample.ios.js +++ b/Examples/UIExplorer/js/TextInputExample.ios.js @@ -689,6 +689,13 @@ exports.examples = [ multiline={true} style={styles.multiline} /> + ; } diff --git a/Libraries/Text/RCTTextViewManager.m b/Libraries/Text/RCTTextViewManager.m index cbbd60a38..0097d71df 100644 --- a/Libraries/Text/RCTTextViewManager.m +++ b/Libraries/Text/RCTTextViewManager.m @@ -62,6 +62,7 @@ RCT_CUSTOM_VIEW_PROPERTY(fontFamily, NSString, RCTTextView) view.font = [RCTConvert UIFont:view.font withFamily:json ?: defaultView.font.familyName]; } RCT_EXPORT_VIEW_PROPERTY(mostRecentEventCount, NSInteger) +RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, textView.dataDetectorTypes, UIDataDetectorTypes) - (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowView *)shadowView {