Conversation
Skip zoomToFit while Blockly holds ephemeral focus for a field editor. The async zoomToFit after BLOCK_CHANGE was stealing DOM focus and closing the editor when tabbing between fields on the same block. Fixes RaspberryPiFoundation/blockly-samples#2636 Co-authored-by: Sharad. <sharadvc@users.noreply.github.com>
Contributor
|
Thanks for the PR! This broadly seems reasonable, but we've recently moved the plugins into the core Blockly repository. Do you mind retargeting it to that repo? The minimap plugin now lives here: https://github.com/RaspberryPiFoundation/blockly/tree/main/packages/plugins/workspace-minimap |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes RaspberryPiFoundation/blockly#10429.
When editing a numeric field on a block and pressing Tab to move to the next field, focus briefly landed on the next field and was then lost. This happened because the minimap mirrored
BLOCK_CHANGEevents and then calledzoomToFit()after queued renders finished. That asynczoomToFit()could run while a field editor still held ephemeral focus, steal DOM focus, and close the editor.Fix
Skip
zoomToFit()while Blockly'sFocusManagerreports ephemeral focus (for example, while a field editor is open). The minimap still mirrors block changes immediately; only the deferred fit/zoom is deferred until editing finishes.Testing
controls_forwithmath_numberinputs, edit the first value, press Tab).@blockly/workspace-minimaptests pass.