TreeView bug: When starting a ContextMenu on a TreeView cell by right clicking on the cell, then this cell must get selected. This works most of the time.
But when there is already a ContextMenu visible for a cell and the user starts the context menu for another cell by right clicking on it, then the old ContextMenu closes and the new ContextMenu starts on the new cell. But the cell selection is stil on the old tree cell, the TreeView does not selects the cell the user clicked on.
This is a problem for the user experience and the event handling. The user will invoke actions on cells which are not selected. And the event handlers are also processing the selected cell, which is the wrong one.
I've attached a Java class for reproducing the problem. This is an example from the official Oracle tutorials. You just need to right click on a group cell and right click on another tree cell afterwards.
But when there is already a ContextMenu visible for a cell and the user starts the context menu for another cell by right clicking on it, then the old ContextMenu closes and the new ContextMenu starts on the new cell. But the cell selection is stil on the old tree cell, the TreeView does not selects the cell the user clicked on.
This is a problem for the user experience and the event handling. The user will invoke actions on cells which are not selected. And the event handlers are also processing the selected cell, which is the wrong one.
I've attached a Java class for reproducing the problem. This is an example from the official Oracle tutorials. You just need to right click on a group cell and right click on another tree cell afterwards.