forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-native-webview+13.8.6.patch
65 lines (65 loc) · 3.23 KB
/
react-native-webview+13.8.6.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/node_modules/react-native-webview/apple/RNCWebView.mm b/node_modules/react-native-webview/apple/RNCWebView.mm
index ec75032..9685c81 100644
--- a/node_modules/react-native-webview/apple/RNCWebView.mm
+++ b/node_modules/react-native-webview/apple/RNCWebView.mm
@@ -318,24 +318,28 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &
#if !TARGET_OS_OSX
if (oldViewProps.dataDetectorTypes != newViewProps.dataDetectorTypes) {
WKDataDetectorTypes dataDetectorTypes = WKDataDetectorTypeNone;
- if (dataDetectorTypes & RNCWebViewDataDetectorTypes::Address) {
+ for (const auto& type : newViewProps.dataDetectorTypes) {
+ if (type == "address") {
dataDetectorTypes |= WKDataDetectorTypeAddress;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::Link) {
+ } else if (type == "link") {
dataDetectorTypes |= WKDataDetectorTypeLink;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::CalendarEvent) {
+ } else if (type == "calendarEvent") {
dataDetectorTypes |= WKDataDetectorTypeCalendarEvent;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::TrackingNumber) {
+ } else if (type == "trackingNumber") {
dataDetectorTypes |= WKDataDetectorTypeTrackingNumber;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::FlightNumber) {
+ } else if (type == "flightNumber") {
dataDetectorTypes |= WKDataDetectorTypeFlightNumber;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::LookupSuggestion) {
+ } else if (type == "lookupSuggestion") {
dataDetectorTypes |= WKDataDetectorTypeLookupSuggestion;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::PhoneNumber) {
+ } else if (type == "phoneNumber") {
dataDetectorTypes |= WKDataDetectorTypePhoneNumber;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::All) {
+ } else if (type == "all") {
dataDetectorTypes |= WKDataDetectorTypeAll;
- } else if (dataDetectorTypes & RNCWebViewDataDetectorTypes::None) {
+ break;
+ } else if (type == "none") {
dataDetectorTypes = WKDataDetectorTypeNone;
+ break;
+ }
}
[_view setDataDetectorTypes:dataDetectorTypes];
}
diff --git a/node_modules/react-native-webview/src/RNCWebViewNativeComponent.ts b/node_modules/react-native-webview/src/RNCWebViewNativeComponent.ts
index 682ab39..09e2bce 100644
--- a/node_modules/react-native-webview/src/RNCWebViewNativeComponent.ts
+++ b/node_modules/react-native-webview/src/RNCWebViewNativeComponent.ts
@@ -202,17 +202,7 @@ export interface NativeProps extends ViewProps {
'recommended'
>;
dataDetectorTypes?: WithDefault<
- ReadonlyArray<
- | 'address'
- | 'link'
- | 'calendarEvent'
- | 'trackingNumber'
- | 'flightNumber'
- | 'lookupSuggestion'
- | 'phoneNumber'
- | 'all'
- | 'none'
- >,
+ ReadonlyArray<string>,
'phoneNumber'
>;
decelerationRate?: Double;