Skip to content

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Apr 11, 2025

The basics

The details

Resolves

Fixes #8880

Proposed Changes

This PR fixes scrolling of contextual menus using the arrow keys. It scrolls the menu item relative to the menu, whereas previously it was scrolling the menu item relative to the menu's parent element. This worked for dropdowns (which have an intermediate div between the menu and the container), but not for contextual menus, where the menu element lived directly in the WidgetDiv. This change broke keyboard scrolling of dropdown menus, but I adjusted their styling to work similarly to context menus. This in turn allowed for the removal of a manual scroll to move the selected dropdown menu item into view, which is now handled automatically by the menu.

@gonfunko gonfunko requested a review from a team as a code owner April 11, 2025 20:05
@gonfunko gonfunko requested a review from RoboErikG April 11, 2025 20:05
@gonfunko gonfunko changed the title fix: Fix keyboard-drmenu scrolling. fix: Fix keyboard-driven menu scrolling. Apr 11, 2025
@gonfunko gonfunko added the PR: fix Fixes a bug label Apr 11, 2025
@gonfunko gonfunko merged commit e45471d into RaspberryPiFoundation:rc/v12.0.0 Apr 14, 2025
8 of 14 checks passed
@microbit-robert
Copy link
Collaborator

@riknoll It's worth highlighting that this fix impacts MakeCode where some of these changes will need to be copied across or negated. We've quickly patched this, but I'm sure there are better approaches. Changes will be required when upgrading from v12.0.0-beta.3 to v12.0.0-beta4.

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.

4 participants