Skip to content

After creating a variable by mouse, the flyout closes. #8976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
sappm01 opened this issue May 2, 2025 · 2 comments · Fixed by #8982
Closed
1 task

After creating a variable by mouse, the flyout closes. #8976

sappm01 opened this issue May 2, 2025 · 2 comments · Fixed by #8982
Labels
issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member

Comments

@sappm01
Copy link

sappm01 commented May 2, 2025

Check for duplicates

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

Description

After creating a variable by mouse, the flyout closes. I don’t think this is the existing experience in blockly demo playground.
Ben: known issue that's explained in the PR description for #8941. Fix is appearing to be tricky.

Reproduction steps

Stack trace

Screenshots

No response

Browsers

No response

@sappm01 sappm01 added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels May 2, 2025
@BenHenning
Copy link
Contributor

Some additional investigating here is suggesting that there is an attempt (somewhere) to restore focus back to the flyout. However, since it was closed, there's nothing to restore. We would need to somehow capture the toolbox category to reselect, or try and avoid the flyout closing altogether. Both are likely viable, but I'm going to try the second one first.

@BenHenning BenHenning linked a pull request May 3, 2025 that will close this issue
1 task
BenHenning added a commit that referenced this issue May 5, 2025
## 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.
@BenHenning
Copy link
Contributor

Fixed by #8982.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants