Skip to content

fix: Restore auto-close behavior for standalone flyouts - #10506

Merged
lizschwab merged 1 commit into
RaspberryPiFoundation:mainfrom
mjgallag:fix/standalone-flyout-autoclose
Sep 21, 2026
Merged

lizschwab merged 1 commit into
RaspberryPiFoundation:mainfrom
mjgallag:fix/standalone-flyout-autoclose

Conversation

@mjgallag

@mjgallag mjgallag commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10510

Proposed Changes

Fixes standalone flyouts with setAutoClose(true) staying open after dragging a block into the workspace.

Standalone flyouts have no category toolbox to handle closing on focus loss. WorkspaceSvg.onTreeBlur now falls back to the flyout's own autoHide method, which respects that setting.

Reason for Changes

Test Coverage

Added standalone flyout tests matching the existing toolbox focus tests, covering auto-close enabled and disabled.

Standalone flyouts have no category toolbox to handle closing when
focus leaves the flyout. Fall back to the flyout's own autoHide method,
which respects its auto-close setting.

Add focus-management tests for standalone flyouts with auto-close
enabled and disabled.
@mjgallag
mjgallag requested a review from a team as a code owner September 17, 2026 20:34
@mjgallag
mjgallag requested a review from lizschwab September 17, 2026 20:34
@github-actions github-actions Bot added the PR: fix Fixes a bug label Sep 17, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:

  • You can find tips about contributing to Blockly and how to validate your changes on our developer site.
  • We use conventional commits to make versioning the package easier. Make sure your commit message is in the proper format or learn how to fix it.
  • If any of the other checks on this PR fail, you can click on them to learn why. It might be that your change caused a test failure, or that you need to double-check the style guide.
    Thank you for opening this PR! A member of the Blockly team will review it soon.

mjgallag added a commit to mjgallag/appinventor-sources that referenced this pull request Sep 17, 2026
@github-actions github-actions Bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Sep 18, 2026
@lizschwab

lizschwab commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Hi Michael,

Thanks for taking a look at this for us. I'm trying to replicate the issue you're describing but I don't see the behavior issue implied by the tests happening in the playground.

Usually we prefer that a fix is created against an issue. Please submit a bug with detailed steps to reproduce the issue that this change is meant to resolve, and then assign that issue to me so that I can take a look.

I do see that if I run your unit tests locally without your changes the Losing focus hides autoclosing flyout test fails, so it does seem to me that there's something going on here; I just want to be able to run the code before and after your changes to manually test it and see the behavior change.

Thanks,
Liz

Edited to add:

When I tested this in the playground, I did the following:

  1. Drag a block out of the toolbox into the workspace
  2. Open the toolbox flyout
  3. Focus the block on the workspace (tried both clicking the mouse and keyboard navigation)

When that didn't work, I tried opening the toolbox and changing the focus from the console using the following code in the chrome devtools console:

Blockly.getFocusManager().focusNode(Blockly.getMainWorkspace().getTopBlocks(false)[0])

With both approaches the flyout was hidden as expected.

@mjgallag

mjgallag commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @lizschwab, thanks for taking a look so quickly! See #10510 for more details and steps to reproduce. Doesn't seem I am allowed to assign to you :)

@github-actions github-actions Bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Sep 19, 2026
@lizschwab

Copy link
Copy Markdown
Contributor

Beautiful, thanks! I was able to manually test this and confirm your fix is working correctly.

@lizschwab
lizschwab merged commit 059e16d into RaspberryPiFoundation:main Sep 21, 2026
15 checks passed
@mjgallag
mjgallag deleted the fix/standalone-flyout-autoclose branch September 21, 2026 16:36
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.

Standalone flyouts do not close after dragging a block when auto-close is enabled

2 participants