Skip to content

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

Description

@mjgallag

Check for duplicates

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

Description

A standalone flyout configured with setAutoClose(true) remains visible after a block is dragged from the flyout into its target workspace.

Expected behavior: The standalone flyout closes after the block is dragged into the workspace because auto-close is enabled.

Actual behavior: The block is created successfully, but the standalone flyout remains visible.

Category-toolbox flyouts close correctly. The problem occurs when the flyout is standalone and therefore has no category toolbox to handle closing when focus leaves the flyout.

This is a regression of previously implemented behavior:

  1. Make autoClose in flyouts/toolboxes toggleable #7506 established that a Simple flyout with autoClose=true should close when a block is dragged out or the workspace is clicked. This behavior was implemented by fix: make autoclose toggleable for flyouts #7634.
  2. feat: Make toolbox and flyout focusable (roll forward) #8939 introduced focus-based flyout closing in Blockly 12.0.0.
  3. fix: Make non-autoclosing flyouts stay open. #9245 removed the direct flyout auto-hide call in Blockly 12.3.0 because category-toolbox flyouts were closed through their owning toolbox. Standalone flyouts have no owning toolbox, but continued closing through the block-creation path.
  4. refactor!: Move responsibility for block creation out of flyouts #9610 removed Flyout.createBlock() and its hideChaff() call in Blockly 13.0.0, exposing the missing focus-loss handling for standalone flyouts.

This regression was found while testing MIT App Inventor's Blockly 13 upgrade in mit-cml/appinventor-sources#4069. That upgrade currently includes the proposed Blockly fix from #10506, which restores the expected behavior in App Inventor.

Reproduction steps

  1. Open Blockly playground.

  2. In the toolbox dropdown, select Simple. This creates a standalone flyout.

  3. Open the browser console and enable auto-close:

    Blockly.getMainWorkspace().getFlyout().setAutoClose(true);
  4. Drag any block from the flyout into the workspace.

  5. Observe that the block is created but the flyout remains visible.

Screenshots

The regression was reported by an App Inventor community tester and demonstrated in this recording.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions