Forum Discussion
Nigel Witherdin
Sep 25, 2019Iron Contributor
SharePoint Online not respecting target="_blank" anymore?
Hi, I have custom spfx webparts that have links in them which the users wish to be opened in a new tab when clicked. This was achieved using the typical target="blank" parameter, but just over the l...
- Sep 26, 2019
Nigel Witherdin you need data-interception="off"
This is a very detailed post explaining the issue:
https://julieturner.net/2018/08/spfx-anchor-tags-hitting-the-target/
Hope this helps
Vikram_Samal
Sep 25, 2019Steel Contributor
Nigel Witherdin I stipped down all styling and tried still the same and opening in new tab.
public render(): void {
this.domElement.innerHTML = `
<div>
<a target="_blank" href="<a href="https://aka.ms/spfx">Click" target="_blank">https://aka.ms/spfx">Click</a> Here</a>
</div>`;
}
Can you try with the different browser just to ensure no other issue.
Nigel Witherdin
Sep 25, 2019Iron Contributor
Its happening in both IE and Chrome, and it is occurring on other sites in our tenancy (so not related to our custom code I guess).
I might have to involve Microsoft directly I guess....