Skip to content

@blockly/keyboard-navigation broken by Blockly version 12.5.0 #9652

@cacklestein

Description

@cacklestein

Check for duplicates

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

Description

Using @blockly/keyboard-navigation v3.0.3 (letest), and Blockly v12.5.0 or 12.5.1 (latest)

Attempting to initialize a KeyboardNavigation instance for a workspace throws the following error:

Uncaught Error: Shortcut named "menu" already exists.
at ShortcutRegistry$$module$build$src$core$shortcut_registry.register
at nt.registerShortcut
at nt.install
at dt.registerDefaults
at dt.init
at new yt

I believe that this is due to the addition of registerShowContextMenu() in packages/blockly/core/shortcut_item.ts

It registers the "menu" shortcut in the shortcuts registry. The keyboard-navigation plugin tries to register "menu" as well, which throws the error.

This issue did not exist before blockly v12.5.0

Reproduction steps

  1. Install @blockly/keyboard-navigation v3.0.3 (latest) and Blockly v12.5.0 or 12.5.1
  2. Attempt to initialize keyboard navigation by creating an instance on KeyboardNavigation for a workspace.
  3. Error is thrown

Priority

No response

Stack trace

Uncaught Error: Shortcut named "menu" already exists.
    at ShortcutRegistry$$module$build$src$core$shortcut_registry.register
    at nt.registerShortcut
    at nt.install
    at dt.registerDefaults
    at dt.init
    at new yt

Screenshots

No response

Browsers

Found on Chrome, but I expect the issue is browser-independent.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bugDescribes why the code or behaviour is wrongissue: triageIssues awaiting triage by a Blockly team member

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions