fix: caret position when editing block comments by maribethb · Pull Request #9153 · RaspberryPiFoundation/blockly

@maribethb

RoboErikG

RoboErikG

riknoll pushed a commit to microsoft/pxt that referenced this pull request

Jun 27, 2025
* Temporary fix for preview branch to fix flyout navigation

* Improve navigation behaviour between toolbox and flyout

Re-focus previously focused block in the flyout if possible.

* Add context menu CSS, drop old workaround

The workaround equivalent shipped in 12.1.0.

* Fix move keyboard shortcut name

The format was aligned with the others in the plugin.

* Handle Blockly focus for blocks with plus / minus buttons

These buttons are removed from the DOM and re-rendered when
interacted with. As a result focus is lost. This change re-focuses
the block when this happens.

* Don't  manage focus for +/- buttons for initial render

* Ignore the previous flyout node if the flyout was closed

* Ignore drag and selected events in shouldEventHideFlyout

* Also ignore BLOCK_MOVE event for shouldEventHideFlyout

* Focus block after interaction with + / - buttons

This includes the expand / collapse buttons for functions.

* Somewhat crufty icon focus fixes.

Hard to tell if the opacity is intended, it's quite odd really but would be a
meaningful visual change.

* Fix moving caret in block comments

Aligns with RaspberryPiFoundation/blockly#9153

Workspace comments need a separate fix from Blockly.

* Revert unintended change

* Add translations used by the keyboard navigation plugin.

* Update to Blockly beta releases

* Clear touch identifier as per Blockly fix

See RaspberryPiFoundation/blockly#9172

---------

Co-authored-by: Robert Knight <robert@microbit.org>