scripts: make ctrl & alt + click work as expected on site links#5
Merged
peaBerberian merged 2 commits intomainfrom Oct 13, 2025
Merged
scripts: make ctrl & alt + click work as expected on site links#5peaBerberian merged 2 commits intomainfrom
peaBerberian merged 2 commits intomainfrom
Conversation
8488dc3 to
184f8af
Compare
773b87b to
a361e26
Compare
I noticed that our sidebar and table-of-content links overrode click interactions (to allow soft navigation) even when the control or alt keys are maintained which are often relied on respectively to open a link in a new tab or a new window. I suppose those shortcuts depend on the browser but I thought that as a quick fix, it made sense to not actually do soft navigation (on the same page) when one of those two keys is maintained during a click.
a361e26 to
c65136a
Compare
585cd4e to
0359bf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Links in our sidebar and table-of-content overrode the default browser click interactions to allow soft navigation.
This is nice excepted when a modifier key such as control or alt keys are maintained - as those are often relied on respectively to open a link in a new tab or a new window. With our current implementation, we would just soft-navigate on the same page.
I suppose those shortcuts depend on the browser. At first I just did exceptions for those two cases, but I grew uneasy because it didn't seem to me to be the right thing to do.
I ended up asking Claude what was the common approach for what I assume is a common problem, and it answered to me the much more exhaustive solution you see here.