handle blockly onchange

125 views
Skip to first unread message

Lam Nguyen Xuan

unread,
Mar 6, 2022, 9:27:57 PM3/6/22
to Blockly
hi all ,  when i put out block child inside block parent this will loop 2 block and 2 log  block out put like this 
Screen Shot 2022-03-07 at 9.21.10 AM.png
put i just want  1 log 1 block put out (block put out )
when put out block child 
my code like this 
Screen Shot 2022-03-07 at 9.24.38 AM.png

Maribeth Bottorff

unread,
Mar 7, 2022, 9:35:58 PM3/7/22
to Blockly
Hello,

There could be two move events generated due to grid snapping (one move event when the user moves the block, and one when blockly moves the block to snap it to the grid). In that case though I would expect that the second one would have the oldInputName set to undefined so it shouldn't be getting logged here. Can you log the actual events (console.log(event)) and share them with us please? That might help us see what's going on. Thanks!

Also, just a friendly reminder that we do check the forum, but we have a 2 business day target response rate, and we don't work over the weekend. Posting the same question multiple times won't help it get answered any faster and can make it more confusing to follow the discussion when there are multiple threads happening simultaneously. Thanks:)

Maribeth

Lam Nguyen Xuan

unread,
Mar 7, 2022, 11:39:39 PM3/7/22
to Blockly
hello Maribeth i'm sorry for any inconvenience  caused.
when i have 2 block and put out child block (console.log(event.type) =>2 log move. i just want 1 log move or anything
Screen Shot 2022-03-08 at 11.31.54 AM.png


this is when i console.log(event)
Screen Shot 2022-03-08 at 11.35.24 AM.png




my code Screen Shot 2022-03-08 at 11.36.49 AM.png

thank you for helping
lam

Maribeth Bottorff

unread,
Mar 8, 2022, 8:12:47 PM3/8/22
to Blockly
It looks like your question may have been answered in the other thread, is that the case? or do you still need help with this issue?

Thanks,
Maribeth

Lam Nguyen Xuan

unread,
Mar 10, 2022, 10:49:53 AM3/10/22
to Blockly
thanks you very much 
Reply all
Reply to author
Forward
0 new messages