Hi all,
first of all great library! Thanks a lot for your work!
https://plnkr.co/edit/uvvAm5E603B7xsXQZSlp?p=preview
Based on this plnkr I have the following problem:
I need to make possible the creation of some blocks, in some "fixed" positions and than, if the user wants, leave open the possibility to delete them.
Fixed because when the block is created I set it to be unmovable.
If you try this plnkr you can see that one time you add the sensor_opt block and connect it to the start_program block you can't select it anymore and therefore you can not delete it.
Do I make it something wrong?
Thanks so much again!
Thanks for the minimal demo! That made it a lot easier to see what was happening.
Looks like there are two things going on:
1) We don't show most of the context menu when a block isn't movable: https://github.com/google/blockly/blame/master/core/block_svg.js#L756
This is deliberate, though I don't know the history of that decision.
2) Only top-level immovable blocks may be selected. This is not deliberate. It's a result of a pass-through in the code, right here: https://github.com/google/blockly/blob/master/core/block_svg.js#L646
We're selecting the immovable block, then allowing the event to continue. The mouse down handler on the parent block is called, which selects the parent block.
sensor_opt block top-level you can select it and hit backspace/delete, but you can't do that on a sensor_opt block that is nested inside the start_program block.I'm renaming this issue to reflect the second part, and I'll keep that in mind as I work on our dragging. There is no simple fix that I can apply in the short term.
I really appreciate your quick response! 馃檪
If I understood well, removing this return makes the windows not draggable if the user click and move the mouse on the immovable block.. Am I right? Do you think I can have worst repercussions doing this?
To be honest, for what I have to do, I think that it is a minor bug compared to the one I have reported. So, waiting for a complete fix I will remove that return in order to workaround my issue!
Thanks you very much again!
A couple other options for workarounds if that doesn't do what you want.
Fixed by #1078