-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Shadow blocks inside statements with mutator input get rendered in insertion marker #7466
Comments
Currently you can check if the block |
Thanks for the hint! This gives a couple of variations. In the context of this example:
original-case-with-bug.mp4
dont-insert-if-parent-insertion-marker.mp4
set-bools-insertion-if-parent-insertion.mp4
Inspired by variant 2, perhaps child blocks could be set as insertion markers as well. (But somehow ensure that this is not applied to blocks already on the workspace, when considering an insertion marker that makes an outer connection). |
I think this is a good idea! Because this issue could also be triggered by people creating shadow blocks in their |
Check for duplicates
Description
When a mutator adds an input with a shadow block, it gets rendered in the statement insertion marker.
It's not just a visual glitch. It accepts connections, so it can turn into a real block. This makes it an orphaned shadow block, which causes a crash when clicked. It seems somewhat related to #7384 and the related recent fixes.
Reproduction steps
The following example is a bit contrived but offers a minimalist way to reproduce. See context below for a more sensible use case. This can be reproduced without the plugin as well; using it just provides a ready-made block with a mutator that exhibits the issue.
+
. Set the bool value toFALSE
to make the difference easier to seeTRUE
).context
The aforementioned demo isn't particularly useful but shadow blocks in mutator statements can have good use cases. Consider, for example:
print
block with a+/-
like mutator that adds additional inputs, each with atext
shadow block for easy text entrycontext 2
Other than this issue, shadow block in mutators work great, so I'm hoping this is a valid use case. For some reason my own application does not reproduce step
7
, so I have only the visual glitch.on json vs xml
This seems unrelated because the same issue reproduces when replacing the patch above with:
But this has a second issue: it renders visually different, and shows the bool block's border rect until you refresh the page to reload it as a normal shadow block. Edit: a
render()
aftersetShadow
and beforeconnect
makes it look correctly (but the main issue persists). Edit2:setShadow
should perhaps always callrenderEfficiently
.Stack trace
No response
Screenshots
update-2023-09-07_09.02.33.mp4
Browsers
No response
The text was updated successfully, but these errors were encountered: