Skip to content

Commit a99a848

Browse files
committed
Added ability to open links in new window/tab, using target="_blank" (cf. #1510 and #2188).
1 parent c43fb61 commit a99a848

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

modules/Link.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ class Link extends React.Component {
7171
if (clickResult === false || event.defaultPrevented === true)
7272
allowTransition = false
7373

74+
// If target prop is set (e.g. to "_blank") let browser handle link.
75+
if (this.props.target) {
76+
if (!allowTransition)
77+
event.preventDefault()
78+
79+
return
80+
}
81+
7482
event.preventDefault()
7583

7684
if (allowTransition)

0 commit comments

Comments
 (0)