Skip to content

fix: Fix a bug that could cause menus to scroll incorrectly on mouseover#9603

Merged
gonfunko merged 2 commits intomainfrom
jumpy-menus
Mar 16, 2026
Merged

fix: Fix a bug that could cause menus to scroll incorrectly on mouseover#9603
gonfunko merged 2 commits intomainfrom
jumpy-menus

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR resolves an issue that caused lengthy dropdown menus to jump/scroll and momentarily display the wrong item as selected on mouseover. Scratch reported this in the variable dropdown, but it affected core as well.

@gonfunko gonfunko requested a review from a team as a code owner February 26, 2026 16:48
@gonfunko gonfunko requested a review from BenHenning February 26, 2026 16:48
@github-actions github-actions bot added the PR: fix Fixes a bug label Feb 26, 2026
height: 16px;
position: absolute;
width: 16px;
display: none;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why is none needed here? That's surprising.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The checkboxes are always present in the DOM, but are only shown when .blocklyMenuItemSelected is applied below. Since they're absolutely positioned here, they're laid out atop the menu items like so:

Image

That means that when the mouse moves over one, the menu attempts to resolve which item it's a child of, but their position doesn't correspond to their corresponding menu items, so the one that's being hovered over might actually be a child of an earlier menu item than where the mouse is, hence the jank. I just deleted this entire rule and moved height/width into the selected case below to make it clearer; now they're still always present in the DOM, but have no bounds (and hence won't be mouse move targets, or be absolutely positioned in such a way that they aren't children of the menu item they're displayed above) which still solves the problem and is hopefully clearer.

@BenHenning BenHenning assigned gonfunko and unassigned BenHenning Feb 26, 2026
@BenHenning BenHenning removed their assignment Mar 16, 2026
@BenHenning
Copy link
Copy Markdown
Collaborator

Thanks @gonfunko!

@gonfunko gonfunko merged commit a6325ed into main Mar 16, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants