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

Disconnect child block before trying to connect #2928

Merged
merged 2 commits into from
Aug 29, 2019

Conversation

alschmiedt
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

Screen Shot 2019-08-27 at 1 35 44 PM

Trying to connect the above scenario was throwing an error in block.setParent because we can not set the parent's svgRoot a one of its children.

Proposed Changes

Disconnect the child block before connecting.

Reason for Changes

Test Coverage

Tested on:

Documentation

Additional Information

Copy link
Contributor

@RoboErikG RoboErikG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One issue, then lgtm.

Blockly.navigation.disconnectChild_ = function(movingConnection, destConnection) {
var movingBlock = movingConnection.getSourceBlock();
var destBlock = destConnection.getSourceBlock();
var disconnectConnection = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disconnectConnection isn't actually be used (it's never set). Remove here and the if statement for it below.

@alschmiedt alschmiedt merged commit cc16bd4 into google:develop Aug 29, 2019
@alschmiedt alschmiedt deleted the fix_insert_child branch May 29, 2020 15:33
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.

2 participants