Skip to content

Fix middle mouse button opening broken release notes link in browser#76487

Merged
mjbvz merged 2 commits intomicrosoft:masterfrom
devsqrl:issue-#76042
Aug 15, 2019
Merged

Fix middle mouse button opening broken release notes link in browser#76487
mjbvz merged 2 commits intomicrosoft:masterfrom
devsqrl:issue-#76042

Conversation

@devsqrl
Copy link
Contributor

@devsqrl devsqrl commented Jul 2, 2019

Fixes #76042

The middle mouse button now has the same effect as the left and right mouse button.
Clicking a link with the middle mouse button scrolls down to the clicked section instead of opening a broken link in the browser.

I tested this by temporarily changing the product version to 1.35 in package.json. Otherwise I was not able to open the release notes. I changed it back to 1.37 for this commit.

@mjbvz mjbvz self-assigned this Jul 3, 2019

// Bubble out link clicks
newFrame.contentWindow.addEventListener('click', handleInnerClick);
newFrame.contentWindow.addEventListener('mousedown', handleInnerClick);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the click event only fires on left mouse button clicks. To prevent the middle mouse button from opening broken links in the browser, I needed to have an event that fires on middle clicks as well.

@mjbvz mjbvz merged commit 15cf335 into microsoft:master Aug 15, 2019
@mjbvz mjbvz added this to the August 2019 milestone Aug 15, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Aug 15, 2019

Thanks! This will be in the next VS Code insiders build. We will see if it causes any problem for people using various input setups

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inside VScode, in release notes, middle-clicking links opens broken link in browser

3 participants