1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

PopupMenu: Add explicit focus order to menu items

Without this VoiceOver will iterate over menu items left to right first,
and iteration order will be affected by whether the PopupMenu gets
broken up into multiple columns due to not enough screen space.
This commit is contained in:
attila 2023-01-18 16:43:39 +01:00
parent 6c720bf3f1
commit a662e5584b

View file

@ -391,6 +391,7 @@ struct MenuWindow : public Component
if (i + 1 < menu.items.size() || ! item.isSeparator)
{
auto* child = items.add (new ItemComponent (item, options, *this));
child->setExplicitFocusOrder (1 + i);
if (initialSelectedId != 0 && item.itemID == initialSelectedId)
setCurrentlyHighlightedChild (child);