Skip to content

Commit 812b937

Browse files
committed
SharePoint#1582 added documentation
1 parent 1cf82ca commit 812b937

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

docs/spfx/hyperlinking.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Hyperlinking considerations in SharePoint Framework (SPFx)
3+
description: Considerations when hyperlinking on a modern page in regards to smart or absolute navigation
4+
ms.date: 11/19/2019
5+
ms.prod: sharepoint
6+
localization_priority: Priority
7+
---
8+
9+
# Hyperlinking considerations in SharePoint Framework (SPFx)
10+
By default on a modern page in SharePoint when a hyperlink is clicked, navigation to the page is achieved via a page router to avoid full refresh of the screen.
11+
12+
When you develop custom SPFx solutions the behavior of smart navigation might not be desirable, especially for scenarios using the `target` attribute to open a page in a separte tab in the browser.
13+
14+
Consider the following markup.
15+
16+
```html
17+
<a href="https://contoso.sharepoint.com/sites/marketing/SitePages/Awesome.aspx" target="_blank">Awesome page</a>
18+
```
19+
20+
In the above example the `target` attribute will be ignored and the page opens in the same tab via page router logic. In order to override the page router for hyperlinks add the `data-interception` attribute to the link with a value of `off`.
21+
22+
```html
23+
<a href="https://contoso.sharepoint.com/sites/marketing/SitePages/Awesome.aspx" target="_blank" data-interception="off">Awesome page</a>
24+
```
25+
26+
When the link is clicked in the above example, the page will open in a new tab.

docs/toc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@
131131
- name: Library component overview
132132
href: spfx/library-component-overview.md
133133
- name: Library component tutorial
134-
href: spfx/library-component-tutorial.md
134+
href: spfx/library-component-tutorial.md
135+
- name: Hyperlinking considerations
136+
href: spfx/hyperlinking.md
135137
- name: External libraries
136138
items:
137139
- name: Add external libraries

0 commit comments

Comments
 (0)