Commit c18c7ff
authored
fix: Fix Flyout auto-closing when creating a var. (#8982)
## The basics
- [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)
## The details
### Resolves
Fixes #8976
### Proposed Changes
Only auto-close the flyout if focus is being lost to a known tree.
### Reason for Changes
I noticed from testing that the system does attempt to restore focus back to the flyout after creating a variable but the auto-closing logic was kicking in due to focus being lost with the variable creation prompt open. Even though an attempt was made to restore focus, this doesn't automatically reopen the flyout (since it is primarily governed by the toolbox selection state).
One alternative might be to try and save the previously selected toolbox category and restore it, but that's tricky. This seems simpler, and also seems to largely maintain parity with pre-focus manager Blockly. Clicking outside of the toolbox with the flyout open only closes it if the click is within the toolbox itself or within the workspace.
### Test Coverage
No new tests were added. However, it may be worth considering this specific case for future tests added with #8915.
### Documentation
No new documentation seems necessary here.
### Additional Information
None.1 parent 6b69541 commit c18c7ff
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2755 | 2755 | | |
2756 | 2756 | | |
2757 | 2757 | | |
2758 | | - | |
2759 | | - | |
| 2758 | + | |
| 2759 | + | |
| 2760 | + | |
2760 | 2761 | | |
2761 | 2762 | | |
2762 | 2763 | | |
| |||
0 commit comments