Skip to content

Opening the context menu on a block in the flyout causes the flyout to close #9111

@microbit-robert

Description

@microbit-robert

Check for duplicates

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

Description

Opening the context menu on a block in the flyout causes the flyout to close. The flyout should remain open in this case.

When the context menu is opened, ephemeral focus is taken, which leads to the focus manager calling onTreeBlur on the focusable tree.

This calls onTreeBlur in workspace_svg.ts.

In the previous version of this code, this function is called with the nextTree being the flyout workspace, this.isFlyout is false and this.targetWorkspace is null.

This function is now called with the nextTree being null, this.isFlyout is true and this.targetWorkspace is the main Blockly workspace. This results in toolbox.clearSelection() being run when it previously didn't.

This change in behaviour may be related to changes made in #9079.

Reproduction steps

Right click on a block in the flyout and observe the flyout closing.

Stack trace

Screenshots

No response

Browsers

No response

Metadata

Metadata

Assignees

Labels

injectionissue: bugDescribes why the code or behaviour is wrong

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions