This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enable 'open in new tab' functionality when clicking link with c…
…trl/cmd
- Loading branch information
1 parent
3b21155
commit 95f7bb2
Showing
2 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* adapted from @reach/router implementation: | ||
* defintion: https://github.com/reach/router/blob/master/src/index.js#L542-L545 | ||
* usage: https://github.com/reach/router/blob/master/src/index.js#L391-L397 | ||
*/ | ||
|
||
const shouldNavigate = event => | ||
!event.defaultPrevented && | ||
event.button === 0 && | ||
!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); | ||
|
||
export { shouldNavigate }; |