From 6ba9e9d31f6228a05c3592e205ca60818c169c61 Mon Sep 17 00:00:00 2001 From: youngvform Date: Sat, 11 Sep 2021 20:05:52 +0900 Subject: [PATCH] [change] Linking.openURL(tel link) call in current tab. --- packages/react-native-web/src/exports/Linking/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-native-web/src/exports/Linking/index.js b/packages/react-native-web/src/exports/Linking/index.js index ddc3e2932..71e06a612 100644 --- a/packages/react-native-web/src/exports/Linking/index.js +++ b/packages/react-native-web/src/exports/Linking/index.js @@ -88,7 +88,11 @@ class Linking { const open = (url) => { if (canUseDOM) { const urlToOpen = new URL(url, window.location).toString(); - window.open(urlToOpen, '_blank', 'noopener'); + if (urlToOpen.startsWith('tel:')) { + window.location = urlToOpen; + } else { + window.open(urlToOpen, '_blank', 'noopener'); + } } };