mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-05 03:09:23 +00:00
[fix] Linking.openURL opens 'tel' links in current tab.
Close #2125 Fix #2124
This commit is contained in:
committed by
Nicolas Gallagher
parent
e217f737ab
commit
438b7b7281
+5
-1
@@ -88,7 +88,11 @@ class Linking {
|
|||||||
const open = (url) => {
|
const open = (url) => {
|
||||||
if (canUseDOM) {
|
if (canUseDOM) {
|
||||||
const urlToOpen = new URL(url, window.location).toString();
|
const urlToOpen = new URL(url, window.location).toString();
|
||||||
window.open(urlToOpen, '_blank', 'noopener');
|
if (urlToOpen.indexOf('tel:') === 0) {
|
||||||
|
window.location = urlToOpen;
|
||||||
|
} else {
|
||||||
|
window.open(urlToOpen, '_blank', 'noopener');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user