Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Fix target=_blank bug #146

Merged
merged 1 commit into from
Dec 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {navigate, getBasepath} from "./router";
*/
export const setLinkProps = (props) => {
const onClick = (e) => {
if (!e.shiftKey && !e.ctrlKey && !e.altKey) {
if (!e.shiftKey && !e.ctrlKey && !e.altKey && props.target !== "_blank")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tugceakin Seems like you accidentally added an extra closing parantheses here ).

@Paratron I have a PR that also fixes this: #152

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Paratron @prageeth the PR I put in #148 already fixes this - all it needs is to be merged by @Paratron :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ogazitt Sorry I should have looked around. I only noticed it when i was fixing my issue with the ForwardRefs in Material UI.

e.preventDefault(); // prevent the link from actually navigating
navigate(e.currentTarget.href);
}
Expand Down