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

Fix the unexpected position of hover widgets #205502

Merged
merged 9 commits into from Feb 23, 2024

Conversation

NriotHrreion
Copy link
Contributor

@NriotHrreion NriotHrreion commented Feb 19, 2024

fix #184740
fix #205353

Description

This is a brief explanation of the changes.

The original code

const top = Math.min(...targetBounds.map(e => e.top));
const right = Math.max(...targetBounds.map(e => e.right));
const bottom = Math.max(...targetBounds.map(e => e.bottom));
const left = Math.min(...targetBounds.map(e => e.left));

will select a bound like this:

屏幕截图 2024-02-19 093414

which will position the hover widget at the top-left corner of the bound. And this will make the link in the widget impossible to reach for the mouse.

The changed code

const { top, right, bottom, left } = targetBounds[0];

will select a bound like this:

屏幕截图 2024-02-19 094124

which makes the widget reachable.

Effect

Before

image

After

image

Tyriar
Tyriar previously approved these changes Feb 23, 2024
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@Tyriar Tyriar added this to the March 2024 milestone Feb 23, 2024
@Tyriar Tyriar closed this Feb 23, 2024
auto-merge was automatically disabled February 23, 2024 22:06

Pull request was closed

@Tyriar Tyriar reopened this Feb 23, 2024
@Tyriar Tyriar merged commit 1e07343 into microsoft:main Feb 23, 2024
9 checks passed
@NriotHrreion NriotHrreion deleted the fix-205353 branch February 24, 2024 01:40
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

Successfully merging this pull request may close these issues.

Can't hover over "Follow link" It's possible for terminal link hovers to be put in unhoverable locations
3 participants