Skip to content

Problem with Link and NavLink #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
birdofpreyru opened this issue Jul 17, 2018 · 0 comments
Closed

Problem with Link and NavLink #25

birdofpreyru opened this issue Jul 17, 2018 · 0 comments
Assignees

Comments

@birdofpreyru
Copy link
Collaborator

if (url.origin !== document.location.origin) {
document.location.assign(to);
e.preventDefault();
/* Scroll to the top-left corner of the page, just in case the link
* references the same page we are already in. */
} else window.scroll(0, 0);

This works right when the link is clicked by letf mouse button. Though, it does not work when it is clicked by the right mouse button. If we arrive to this case, react-router always considers to value as a relative address, and appends it to the current domain in the link. Should be reverted to server-side rendering solution via Redux, where domain is extracted from the request and used to render instead of

@birdofpreyru birdofpreyru self-assigned this Jul 17, 2018
birdofpreyru added a commit that referenced this issue Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant