Conversation
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.
There was a problem hiding this comment.
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.
|
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 Thanks, Edited to add: When I tested this in the playground, I did the following:
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:
With both approaches the flyout was hidden as expected. |
|
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 :) |
|
Beautiful, thanks! I was able to manually test this and confirm your fix is working correctly. |
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.onTreeBlurnow falls back to the flyout's ownautoHidemethod, which respects that setting.Reason for Changes
Flyout.createBlock()and itshideChaff()call, exposing the missing standalone-flyout focus handling.Test Coverage
Added standalone flyout tests matching the existing toolbox focus tests, covering auto-close enabled and disabled.