Skip to content
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

fix: Select replacement for selected shadow block. #2457

Merged
merged 1 commit into from
Sep 5, 2024

Conversation

johnnesky
Copy link
Member

The basics

The details

Resolves

Fixes #2426

Proposed Changes

The shadow block converter plugin now detects if the shadow block being replaced was selected, and if so, it selects the block that took the place of the shadow block.

Reason for Changes

This maintains apparent continuity of the selection when a selected shadow block is edited by the user and replaced with a real block by the shadow block converter plugin.

Note that prior to google/blockly#8172 clicking on a shadow block actually selected the parent block, and this selection was maintained even if the shadow block was deleted.

After google/blockly#8172 clicking on a shadow block selects that shadow block. This means that if the shadow block is deleted, then the selection is cleared, which could be unexpected in the case of the shadow block converter plugin. This PR fixes that.

See also google/blockly#8533 which addresses the visual glitches described in #2426

Test Coverage

I added a unit test method for the new behavior.

@johnnesky johnnesky requested a review from a team as a code owner September 5, 2024 02:15
@johnnesky johnnesky requested review from gonfunko and removed request for a team September 5, 2024 02:15
@johnnesky johnnesky merged commit b127923 into google:master Sep 5, 2024
10 checks passed
@johnnesky johnnesky deleted the nesky-selected-shadow branch September 5, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shadow Block Converter Plugin Parent Block Visual Selection Bug
2 participants