fix: prevent super.transitionTo()
call when Cmd+Click is used
#482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately, I screwed up when I implemented #473 😞
Before all of this, when you Cmd+Click a link it would open the link in the same tab by doing
transitionTo()
and callingpreventDefault()
.After #473, it would open the link in a new tab, due to the skipped
preventDefault()
, but it would also navigate to the link in the current tab due to thetransitionTo()
call that is still happening.This PR changes the code to skip both
preventDefault()
andtransitionTo()
if we detect that the user used a modifier key or a non-primary mouse button. This results in the link only being opened in the new tab, but the current tab staying on the same page.