[ad_1]
I’ve a hyperlink that, when clicked, creates an factor which is a hyperlink that ought to direct the consumer to a brand new web page.
I would like this hyperlink to work for all platforms.
For some cause it would not open when iOS is clicked in Safari Browser.
How do I workaround for it to additionally work in Browser Safari.
It’s value mentioning that it really works on all platforms and browsers, apart from the talked about one.
const requestDownloadToken = (occasion, invoicePath) => {
occasion.preventDefault();
setInvoiceDownloadToken().then(response => {
if (response.standing === 201) {
const hyperlink = doc.createElement('a');
hyperlink.href = `${invoicePath}?key=${response.knowledge.invoice_token}`;
hyperlink.goal="_blank";
hyperlink.rel = "noreferrer noopener";
hyperlink.click on();
}
}).catch(error => {
// eslint-disable-next-line no-console
console.log(error);
});
};
const invoiceLink = (bill, index) => {
let invoicePath = getGeminiAbsolutePath(II_STACK);
invoicePath = invoicePath.concat(getGeminiDashboardApiPath().concat(bill.hyperlink));
return (
<CriticalScopes
element="hyperlink"
baseUrl={getComFEAbsolutePath(II_STACK)}
locale={currentLocale()}
>
<a
rel="noreferrer"
href="#"
data-testid={`billing-invoice-link-${index}`}
goal="_blank"
className={types['invoice-link']}
onClick={occasion => requestDownloadToken(occasion, invoicePath)}
>
{bill.date_formatted}
</a>
</CriticalScopes>
);
};
[ad_2]
