Blocks Editor Inconsistent Pop-up Menu Behavior

Many powerful and useful functions appear in the blocks editor pop-up menu (right-click in empty space). However, I have encountered very troublesome, odd and inconsistent behavior. If it were only odd - but consistent - it would be much less of a problem :slight_smile:

Evidently, best I can tell, this is troubling other users also:

https://community.appinventor.mit.edu/t/warning-when-select-menu-for-enable-all-block-disable-all-block/32109
https://community.appinventor.mit.edu/t/mouse-right-click-menu/8391/2
https://community.appinventor.mit.edu/t/pop-up-menu-error/23344

The usual - and I believe intended/designed behavior - is that a right click displays the menu and places the cursor outside the menu function selection window. The cursor can then be moved with the mouse to select the desired function and a left mouse click executes the selected function. The odd and unexpected thing is that after selecting the option with the mouse, a right-click will also execute the option. Although this is not a problem in and of itself, when combined with the inconsistency explained below, trouble looms large.

[Sorry no cursor appears in the above screen grab. It is generally placed in area near the lower left hand corner of the popup window.]

The inconsistent issue is that sometimes [(?) when the cursor lies closer to the right-hand edge of the blocks editor window than the width of the popup window] the right click-down displays the menu with the cursor placed inside the selection menu, having selected a nearby menu option. Then, on the inevitable right "click-up", the selected option is executed - almost always unintentionally and with potential drastic, unexpected (even unrealized) results.

The only defense (workaround) I have found is to always right click on the left hand side of the editor workspace so that the menu can be placed to the right of the cursor without "running into" the right hand side of the editor window.

If you MUST click on the right hand side of the editor window - nearer the edge than the width of the popup menu - then click-down and hold, then move the cursor to the desired option BEFORE you click-up and execute the option.

[Edit 2025-06-13T03:31:00Z - issue extends to blocks.]
I should add that the problem also exists when right clicking on a block itself not just on the blank canvas.

A fix to this (I assume this is a bug and unintended behavior - and not operator error) could be:

  1. Always position the mouse outside the menu area on right click-down. Then no option would be selected - even if up right up-click would still execute any a selected option, or

  2. Disable the right mouse click from executing a selection. That way, even if, on the right click-down, the mouse were positioned over an option inside the menu, thereby effecting a selection, it would not be executed on click-up, but would require a separate LEFT-click, presumably after selecting the desired option.

It seems to me that only one of these changes need be made to prevent the inevitable accidental violence done to the projects of the novice and the experienced alike. (The one that got me was a Disable All Blocks (or Enable All Blocks - either one removes any intentional distinction between the two) in a 1000+ blocks project)

I cannot demonstrate it, but I suspect that Undo cannot be depended upon to recover from all such mayhem. Before the damage it is realized, other actions may have been executed... and just exactly which option (or options) were executed may not be known...It is a very confusing and disorienting experience :frowning:

I am writing this post for several reasons including:

  1. To have an AI2 expert confirm that this is indeed the current behavior of the blocks editor and that I am not misusing it, nor have a problem with my environment that causes this.

  2. To inform others as to the workarounds I use.

  3. To determine from feedback if I should generate an enhancement request for a fix. Is it feasible? Is is enough of a general problem to make it worth while?

I have not read everything on the forum relating to this, so perhaps answers to the above have already been posted. If so I apologize...please point me to them.

With kind regards,
Randal

Dear @Randal_Andress,
yes, the behaviors you've posted are affectively as you say. Most probably everyone has adopted his own countermeasure (as you did :grin:) and "survives" with the aid of such tricks.
It has also happened to me that by right clicking on the right edge of the screen an unwanted activity, such rearrange all the blocks, od collapse them, got me crazy, but the Ctrl-Z normally has saved me.
Anyway, thanks for your advice and remember that by saving an .aia, many times during the development, or by using the "checkpoint" option, both allow you to restart from a steady point, in case of your code has messed up.
Best wiashes !!!

Thank you @uskiara for confirming that this is "normal" :slight_smile: Now that I am aware of it, I can act defensively to avoid or minimize the damage.

Right! Normally I checkpoint at some known/stable point to which I may wish to return such as before I make intentional, possibly significant, changes. But to protect against this, I should save periodically whether or not I intend to make significant changes or not. I suppose a periodic save option is another potential "fix" that could be implemented to the Blocks editor.

Thanks very much for your comments!

Kind regards,
Randal

1 Like