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

Enable a block to change connectors while dragging #5720

Closed
mark-friedman opened this issue Nov 17, 2021 · 1 comment · Fixed by #5722
Closed

Enable a block to change connectors while dragging #5720

mark-friedman opened this issue Nov 17, 2021 · 1 comment · Fixed by #5722

Comments

@mark-friedman
Copy link
Contributor

Is your feature request related to a problem? Please describe.

With the current Blockly implementation, if I change a block's connections while dragging (via, say, an event handler) it doesn't correctly modify it's insertion marker block, nor does it correctly update the insertion marker manager's set of available connections. In the former case is throws an error when the obsolete marker block approaches a potential connection. In the latter case, it doesn't highlight all the potential connection points.

Describe the solution you'd like

I would like to be able to change a block's connectors while dragging. More specifically:

  • I would like InsertionMarkerManager.showInsertionMarker_() to recreate the insertion marker block in the case where its call to imBlock.getMatchingConnection() throws an error.
  • I would like InsertionMarkerManager.getCandidate_() to update its available connections.

Note that I intend to file a PR for these changes.

Describe alternatives you've considered

Additional context

I would like to be able to create a "chameleon" block which would have previous, next and output connections when
created, so that it could be used as either a value or a statement. Once it is actually connected it would change to an appropriate shape depending on its context. When it is dragged out of its connection I would like it to be able to change back to a state where it has all the connectors again.

Note that this is somewhat of a sibling issue with #5691. With that feature and this one I would be able to have a dynamic chameleon block.

@alschmiedt
Copy link
Contributor

Closing since it was resolved in #5722.

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 a pull request may close this issue.

2 participants