Skip to content
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

How to prevent default redirection on "main"-tab when you control-click a link #80

Closed
Parweiz opened this issue May 6, 2021 · 2 comments

Comments

@Parweiz
Copy link

Parweiz commented May 6, 2021

First of all, I'd thank all the contributions for this awesome package. It works smooth for me.

Now, for my issue. Is there a way to prevent the app to route to a specific section when you control-click links? What I mean by that is that, if I control click a link, then both the "main"-tab and the new tab redirects me to a specific section.

That's not supposed to happen, as the whole point with control-click links is that you open the content/link on a new tab meanwhile the "main"-tab stands still.

PS.: I used the provided URL for live demo app.

@rafgraph
Copy link
Owner

rafgraph commented May 6, 2021

Hi, thanks for reporting the issue, I think it's a bug. The functionality should probably mimic React Router and ignore clicks with modifier keys: https://github.com/ReactTraining/react-router/blob/fc91700e08df8147bd2bb1be19a299cbb14dbcaa/packages/react-router-dom/modules/Link.js#L17-L19

Feel free to make a PR, or I can try to get to it.

@rafgraph
Copy link
Owner

@Parweiz this should be fixed in v2.4.2

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

2 participants