mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Add WebView.dataDetectorTypes prop.
Summary: WebView component detect phone numbers in html as URL links by default. But sometimes we don't want this behavior. This PR add dataDetectorTypes as a prop of WebView, so one can specify value of this prop as one or more of phoneNumber/link/address/calendarEvent/none/all This prop maps to UIWebView.dataDetectorTypes Closes https://github.com/facebook/react-native/pull/8743 Differential Revision: D3556440 fbshipit-source-id: 55f01d2cdd785381f261a9dc931aa9311f0ad1d4
This commit is contained in:
committed by
Facebook Github Bot 6
parent
8dd8c41553
commit
8612d7640d
@@ -66,6 +66,7 @@ typedef NSURL RCTFileURL;
|
||||
+ (UIKeyboardType)UIKeyboardType:(id)json;
|
||||
+ (UIKeyboardAppearance)UIKeyboardAppearance:(id)json;
|
||||
+ (UIReturnKeyType)UIReturnKeyType:(id)json;
|
||||
+ (UIDataDetectorTypes)UIDataDetectorTypes:(id)json;
|
||||
|
||||
+ (UIViewContentMode)UIViewContentMode:(id)json;
|
||||
+ (UIBarStyle)UIBarStyle:(id)json;
|
||||
|
||||
@@ -319,6 +319,15 @@ RCT_ENUM_CONVERTER(UIKeyboardType, (@{
|
||||
@"numeric": @(UIKeyboardTypeDecimalPad),
|
||||
}), UIKeyboardTypeDefault, integerValue)
|
||||
|
||||
RCT_MULTI_ENUM_CONVERTER(UIDataDetectorTypes, (@{
|
||||
@"phoneNumber": @(UIDataDetectorTypePhoneNumber),
|
||||
@"link": @(UIDataDetectorTypeLink),
|
||||
@"address": @(UIDataDetectorTypeAddress),
|
||||
@"calendarEvent": @(UIDataDetectorTypeCalendarEvent),
|
||||
@"none": @(UIDataDetectorTypeNone),
|
||||
@"all": @(UIDataDetectorTypeAll),
|
||||
}), UIDataDetectorTypePhoneNumber, unsignedLongLongValue)
|
||||
|
||||
RCT_ENUM_CONVERTER(UIKeyboardAppearance, (@{
|
||||
@"default": @(UIKeyboardAppearanceDefault),
|
||||
@"light": @(UIKeyboardAppearanceLight),
|
||||
|
||||
@@ -47,7 +47,7 @@ RCT_EXPORT_VIEW_PROPERTY(onLoadingError, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onShouldStartLoadWithRequest, RCTDirectEventBlock)
|
||||
RCT_REMAP_VIEW_PROPERTY(allowsInlineMediaPlayback, _webView.allowsInlineMediaPlayback, BOOL)
|
||||
RCT_REMAP_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, _webView.mediaPlaybackRequiresUserAction, BOOL)
|
||||
|
||||
RCT_REMAP_VIEW_PROPERTY(dataDetectorTypes, _webView.dataDetectorTypes, UIDataDetectorTypes)
|
||||
|
||||
RCT_EXPORT_METHOD(goBack:(nonnull NSNumber *)reactTag)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user