Skip to content

fix: forward shadow block context menu to parent#10070

Open
mikeharv wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
mikeharv:shadow-menu
Open

fix: forward shadow block context menu to parent#10070
mikeharv wants to merge 1 commit into
RaspberryPiFoundation:mainfrom
mikeharv:shadow-menu

Conversation

@mikeharv

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9999

Proposed Changes

  • Update BlockSvg.showContextMenu so shadow blocks forward to the nearest non-shadow ancestor instead of opening their own menu.
  • Focus that ancestor before delegating

Reason for Changes

Shadow blocks do not have context menus for mouse users, but keyboard users can still focus them and trigger one (e.g. Ctrl/Cmd+Enter). Forwarding to the owning block matches mouse/pointer behavior and exposes the parent’s relevant actions.

Test Coverage

Added a Block showContextMenu suite in contextmenu_test.js covering value-input shadow forwarding, nested input shadows, and a non-shadow regression case.

@mikeharv mikeharv requested a review from a team as a code owner June 25, 2026 19:36
@mikeharv mikeharv requested a review from maribethb June 25, 2026 19:36
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jun 25, 2026
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.

Context menu items for shadow blocks behave inconsistently

2 participants