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

Position correctly when inserting before another block (from the flyout) #2415

Merged

Conversation

rachel-fenichel
Copy link
Collaborator

@rachel-fenichel rachel-fenichel commented Apr 26, 2019

The basics

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

The details

Resolves

Previously the block stack would move to 100, 100 on the workspace if the new block was being inserted at the start.

Proposed Changes

Use the same code that we use to solve this problem for insertion markers.
I moved the helper function and changed its signature because it had an unnecessary param before. That's the first commit. The second commit uses it.
Remove extra connect calls in insertBlock--connect moves the orphanBlock around internally.

Reason for Changes

Blocks need to stay in the same place as new blocks are connected.

Test Coverage

Tested in the playground.

Additional information

I had to add a call to render so that the new block's connection positions are correct internally. That I expected. I also had to explicitly set the connections to not be hidden, which I didn't expect. The connections are hidden in domToBlock and unhidden in a timeout, for speed when creating large block stacks. But if the connections are still hidden when I move the block, Erik's new code in #2003 makes the child block disappear.

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.

lgtm

@rachel-fenichel
Copy link
Collaborator Author

Lint errors in astnode_test, probably from recent rebase. I'll fix indentation and then merge.

@rachel-fenichel rachel-fenichel merged commit 3966bec into google:keyboard_nav Apr 26, 2019
@rachel-fenichel rachel-fenichel deleted the bugfix/insert_before branch April 26, 2019 21:23
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.

None yet

2 participants