fix: prevent helpfulWheel from appearing on block right-click#4219
fix: prevent helpfulWheel from appearing on block right-click#4219walterbender merged 3 commits intosugarlabs:masterfrom
Conversation
|
@walterbender I tried this fix by capturing the location for blocks and based on that, I am allowing opening of the menus, what do you think about this |
|
This approach makes sense to me. We need to establish the context. |
|
The alternative would be to put the event handler into each block. |
|
I am pretty sure we have a function (probably in blocks.js) that finds the block at an X,Y location. We could reuse that. If not, we should create it in blocks.js and make it a more general utility. |
|
Sure,I will look into the blocks.js file and if the function is not there, ill just add it |
…d the right click detection on blocks
|
@walterbender I could not detect any function specifically for detecting block clicks, so I created one in blocks.js, is it good to go? |
|
The block click detection function in blocks.js (isCordinateBlock) can be used in #4213 and other places where this might be helpful |
|
One small bit of cleanup and I think we are ready to merge. Thx |
|
Thanks for pointing that out, I have corrected it now and I will be more careful in future. |
#4217
Changes made
doContextMenusevent handler to check if right-click intersects with block coordinatesBefore fix:
Screencast from 02-01-25 12:03:14 AM IST.webm
After fix:
Screencast from 02-01-25 12:40:36 AM IST.webm