Hi,
Two small accessibility issues we ran into while testing our app with VoiceOver. Both are still there in 9.0.4 and on develop.
-
Radio buttons
The toggle action in ButtonAccessibilityHandler just does setToggleState (! getToggleState()). On a button that is part of a radio group and already selected, this turns it off, so the group ends up with nothing selected. A mouse click can’t do that. On macOS it’s easy to hit, because accessibilityPerformPress calls toggle first for any checkable element, so a VoiceOver user pressing the current tab of a tab bar made of radio buttons just deselects it.
I’d expect toggle to do nothing when getRadioGroupId() != 0 and the button is already on, the same as a click. -
TreeView
The press action of a tree item calls itemClicked() with a fake left-click MouseEvent, but it never selects the item. With the mouse, the item is selected in mouseDown before itemClicked() is called. Code that reacts to itemSelectionChanged() (a file/volume browser in our case) therefore does nothing when the item is pressed from VoiceOver.
Selecting the item (setSelected (true, true)) before calling itemClicked() in onPress would match the mouse behaviour.
Small repro attached. Run it with --check and it invokes the accessibility actions through the components’ handlers and prints:
click on selected radio ‘A’: A=1 B=0
toggle on selected radio ‘A’: A=0 B=0 → BUG: no button selected in the group
press on tree item ‘Second’: itemClicked calls=1 selected=0 → BUG: a mouse click would have selected it
Without --check the window stays open, so you can try it with VoiceOver: press “A” while it’s selected, then press “Second” in the tree.
Thanks!
CMakeLists.txt (838 Bytes)
Main.cpp (4.2 KB)