-
Notifications
You must be signed in to change notification settings - Fork 41
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
fix: update link component to allow modifier+click to properly work, and write tests #534
Conversation
To test in docs, replace tuono version in package.json with 2025-02-08.15-46-52.mp4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. I think you are on the right track!
I think the time has come for adding also an integration test for the Link
component. Too many conditions.
Do you mind adding them within this PR? Let me know if you need help
Agreed, I'm happy to do that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now all links now open in a new tab, with or without modifier key pressed.
This behaviour is caused by the code of MdxLink
:
<Anchor | |
component={Link} | |
{...props} | |
target="_blank" | |
variant="transparent" |
This issue was hidden by the event.preventDefault
always executed on Link
click event handler.
The target="_blank"
should be removed from MdxLink
component when rendering internal links.
Checklist
Related issue
Fixes #531
Overview
This PR makes the link fallback to default
a
behaviour when a modifier key is being pressed.