The menu is displayed twice when right clicking a TextEditor. The user needs to select the action twice or click away twice to discard the menu. The behaviour can be easily reproduced on the Projucer.
Checking for an active menu before showing a new one in TextEditor::mouseDown() fixes the issue:
if (! (popupMenuEnabled && e.mods.isPopupMenu()))
{
moveCaretTo (getTextIndexAt (e.getPosition()), e.mods.isShiftDown());
if (auto* peer = getPeer())
peer->closeInputMethodContext();
}
else if (!menuActive) // <--
{
PopupMenu m;
m.setLookAndFeel (&getLookAndFeel());
addPopupMenuItems (m, &e);
menuActive = true;
