mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
PopupMenu: Fix accessibility issue where ticked items couldn't be pressed
The issue became manifest in c51b331318.
In our implementation the toggle action takes precedence over the press
action, making the latter unreachable when the Item is in a checkable
state. Calling isTicked (true) turns the Item into a checkable object.
The onToggle implementation however didn't interact with the isTicked
state, and it didn't fire the press action either. This made the item
non-interactable with screen readers once it got into a ticked state.
This commit is contained in:
parent
b1e19da5f5
commit
79ded8c1f3
1 changed files with 2 additions and 11 deletions
|
|
@ -250,7 +250,7 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
static AccessibilityActions getAccessibilityActions (ItemAccessibilityHandler& handler,
|
||||
static AccessibilityActions getAccessibilityActions (ItemAccessibilityHandler&,
|
||||
ItemComponent& item)
|
||||
{
|
||||
auto onFocus = [&item]
|
||||
|
|
@ -260,16 +260,7 @@ private:
|
|||
item.parentWindow.setCurrentlyHighlightedChild (&item);
|
||||
};
|
||||
|
||||
auto onToggle = [&handler, &item, onFocus]
|
||||
{
|
||||
if (handler.getCurrentState().isSelected())
|
||||
item.parentWindow.setCurrentlyHighlightedChild (nullptr);
|
||||
else
|
||||
onFocus();
|
||||
};
|
||||
|
||||
auto actions = AccessibilityActions().addAction (AccessibilityActionType::focus, std::move (onFocus))
|
||||
.addAction (AccessibilityActionType::toggle, std::move (onToggle));
|
||||
auto actions = AccessibilityActions().addAction (AccessibilityActionType::focus, std::move (onFocus));
|
||||
|
||||
if (canBeTriggered (item.item))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue