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(tooltip): capture mouse coordinates on mouseover events #1696

Merged

Conversation

wescopeland
Copy link
Member

Resolves https://discord.com/channels/310192285306454017/1133391926402490388.

Root Cause
When landing on a tooltipped element using only the mouse wheel and no mouse movement, an onmouseover event is fired to pop the tooltip. However, the event is not capturing the mouse coordinates, resulting in the tooltip to be incorrectly positioned on the top left corner of the screen.

To resolve the issue, the mouse coordinates are now captured and utilized correctly.

@wescopeland wescopeland requested a review from a team July 25, 2023 21:31
@Jamiras
Copy link
Member

Jamiras commented Jul 27, 2023

These seems to have fixed the issue on the Game Awards list. Instead of the popup appearing in the upper left corner as reported, mine just sometimes didn't show up at all, and with this change, it does always show up.

I'd like to report a similar issue on the active claims widget and recent forum posts. If you hover over a user to get a tooltip, then mousewheel so the cursor is over a different user, the tooltip appears in the same place as the first user. This seems to be related to fetching the user card info. It only happens the first time after refreshing the page.

Here, I hovered over GameZone, then mousewheeled to televandalist. You can see televandalist highlighted, but the tooltip appears next to GameZone.
image

@wescopeland
Copy link
Member Author

@Jamiras To confirm, is this also happening locally with this branch (want to know if resolved by this conditional https://github.com/RetroAchievements/RAWeb/pull/1696/files#diff-240d4470ee3ede50a8ab91e0f5db2692756d9e8c9311ae74060c94cca2fa695bR38)?

@Jamiras
Copy link
Member

Jamiras commented Jul 27, 2023

Yes, the user tooltip issue is happening on both master and the branch.

@wescopeland
Copy link
Member Author

Okay, I've been banging around on that page and I've just pushed a commit to fix the reported issue & another race condition I found with these dynamic tooltips where they sometimes would freeze onto the page if the user moused away too quickly.

Let me know if things look any better on your end now.

Copy link
Member

@Jamiras Jamiras left a comment

Choose a reason for hiding this comment

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

Confirmed functionality on user awards (original issue) and user tooltips on claims and recent posts (secondary issue).

@wescopeland wescopeland merged commit e7a6d9a into RetroAchievements:master Jul 28, 2023
5 checks passed
@wescopeland wescopeland deleted the toolip-mouseover-coords branch July 28, 2023 21:49
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.

2 participants