fix: Make non-autoclosing flyouts stay open. by gonfunko · Pull Request #9245 · RaspberryPiFoundation/blockly

The basics

The details

Resolves

Fixes #9126

Proposed Changes

This PR fixes the behavior for non-autoclosing flyouts. As part of the recent focus changes, flyouts were more or less forced to always autoclose. This is because Toolbox.clearSelection() winds up calling this.setSelectedItem(null) -> this.updateFlyout(*, null), and the latter unconditionally hides the flyout if the new item is null. Now, in situations where the toolbox is losing focus, its autoHide method is called, which gates the call to clearSelection() on a check for whether the toolbox's flyout is in autoclose mode. The explicit call to Flyout.autoHide in WorkspaceSvg has been removed because it's redundant as the prior call to autoHide() on the toolbox will wind up invoking it.