Radio button group labels not being spoken
If a labelled-by relationship exists between one or more radio buttons and a label, the screen reader does not read the label; just the names of the radio buttons.
This is not adequate to describe a common use-case for radio buttons, where (for example) there are two radio buttons whose individual labels are "enabled" and "disabled", and which sit next to a label used to indicate precisely what is being enabled or disabled. In this case, the reader only says "enabled" or "disabled", which does not give enough context to explain what the buttons do.
Looking at the code, one fix for this is to change line 399 of formatting.py from
pyatspi.ROLE_RADIO_BUTTON: {
'focused': 'radioState',
'unfocused': '(name or label) + pause + radioState + roleName + availability + lineBreak + ' + MNEMONIC + ' + accelerator + pause + positionInList + pause',
'basicWhereAmI': 'radioButtonGroup + pause + (name or label) + roleName + pause + radioState + pause + positionInGroup + ' + MNEMONIC + ' + accelerator'
},
to
pyatspi.ROLE_RADIO_BUTTON: {
'focused': 'radioState',
'unfocused': 'radioButtonGroup + pause + ((name or label) + pause + radioState + roleName + availability + lineBreak + ' + MNEMONIC + ' + accelerator + pause + positionInList + pause',
'basicWhereAmI': 'radioButtonGroup + pause + (name or label) + roleName + pause + radioState + pause + positionInGroup + ' + MNEMONIC + ' + accelerator'
},
to match the line below, and this does indeed mean that radio buttons are read with sufficient context to be useful, but I don't know if the absence of radioButtonGroup in this line is deliberate or an oversight?