Warning: Using ContextualMenu on previous Xojo versions

If you fall into a trap trying to implement a ContextualMenu and recall having read this entry… use Xojo 2023r1.1 to test your code. And if you have to use the Xojo version that behave the bug, read the workaround below.

I wasted my time on a feature and, at last, I discovered it was a Xojo Bug.

That bug exists since… 2015r1 thru 2021r2.1 and maybe later. It was removed in 2023r1.1 (or earlier…).
I’ve made a search on the Release Notes, but found none. So I do not know when this bug was removed.

The feature:

Add ContextualMenu(s) to a ListBox with SubMenus(s),
Click at the rightmost ListBox position and choose a SubMenu
(The Mouse have to be released outside of the ListBox)

The ListBox.ColumnCount is “resized” to 1.

The workaround is to check for the x position: it have to be less than the ListBox width.

BTW: I do not tested if this do the same for y.

For what is worth.

Doh: 4 wasted hours since I suspected a Xojo bug (I installed Xojo 2023r1.1, 4 hours ago, to make tests).