Every modern page in SharePoint, by default, uses a page router(smart navigation) when a hyperlink is clicked to navigate. This behavior is intentional to avoid a complete refresh of the screen.
During development using SPFx( SharePoint Framework), smart navigation behavior might not be the expected one in all cases, as one of its consequences is using the target
attribute to open a page in a separate tab in the browser will be ignored.
Consider the following valid HTML markup, which will work outside SPFx:
Valid HTML
<a href="https://yourSharePoint.sharepoint.com/sites/hr/home.aspx" target="_blank"> HR Home </a>
In the above case, the target
attribute will be ignored, and the page opens in the same tab via page router logic. To override the page router for hyperlinks, add the data-interception
attribute to the link with a value of off as shown below
.
HTML that would work in SPFx
<a href="https://yourSharePoint.sharepoint.com/sites/hr/home.aspx" target="_blank" data-inception="off"> HR Home </a>
When the link is clicked in the above example, the page will open in a new tab.
Have a nice day!!