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

Add support for a dropdown menu separator #8752

Open
1 task done
microbit-robert opened this issue Jan 30, 2025 · 1 comment
Open
1 task done

Add support for a dropdown menu separator #8752

microbit-robert opened this issue Jan 30, 2025 · 1 comment
Assignees
Labels
issue: feature request Describes a new feature and why it should be added

Comments

@microbit-robert
Copy link

microbit-robert commented Jan 30, 2025

Check for duplicates

  • I have searched for similar issues before opening a new one.

Problem

MakeCode inserts an empty dropdown item with role="separator" and custom styling into some dropdowns to separate values from actions. This dropdown item is not treated any differently as far as keyboard navigation is concerned. As a result, when moving up and down inside the dropdown, the menu separator takes the selection, albeit in a non-obvious way. See the video below for an example of this. Keyboard navigation should only visit the 4 'real' items in this dropdown, however, it also visits the menu separator as a 5th item.

Screen.Recording.2025-01-30.162244.mp4

Request

Please can you consider adding support for menu separators in dropdowns? Keyboard handling and aria roles for these separators can then be implemented correctly and centralized in Blockly. An alternative might be the ability to pass options for a menu item that could include removing it from other keyboard navigable items in some way.

Alternatives considered

No response

Additional context

I have opened a PR in MakeCode in an attempt to fix this issue, however, it is very much a workaround added to an existing workaround.

@microbit-robert microbit-robert added issue: feature request Describes a new feature and why it should be added issue: triage Issues awaiting triage by a Blockly team member labels Jan 30, 2025
@cpcallen
Copy link
Contributor

cpcallen commented Feb 7, 2025

Notes from triage:

  • Yes, we'd like to do this.
  • Probably via by adding | string to the MenuOption type in core/field_dropdown.ts, with the string "separator" denoting a separator (allowing extensibility for other special menu pieces).

@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Describes a new feature and why it should be added
Projects
Status: Todo
Development

No branches or pull requests

3 participants