Skip to content

Conversation

AngeloStavrow
Copy link
Collaborator

Closes #159.

This PR adds better labels and hints to icon-only buttons for VoiceOver users. Some hacks were required to workaround a SwiftUI where accessibility modifiers are not used as expected for buttons in toolbars (see FB8956392), and comments to this effect are present in the source code committed.

I'm not sure of a way to test this without a device, so I made a recording of VoiceOver reading out some of the icon-only button labels, as well as the post editor text fields (watch with sound on 🎧):

voiceover-demo.mov

This is to silence runtime warnings about missing images for the workaround used to add a11y labels/hints to toolbar buttons.
It’s impossible to differentiate these textviews because the placeholder text is not read by VoiceOver, so we need to add labels.
Adding an .onTapGesture modifier here to dismiss the keyboard removes focus from whatever textview is active in the post editor, which prevents VoiceOver from getting confused about which accessibility frame should be read.
@AngeloStavrow AngeloStavrow self-assigned this Dec 30, 2020
@AngeloStavrow AngeloStavrow added this to the 1.0.2 milestone Dec 30, 2020
@AngeloStavrow AngeloStavrow added ios Anything specific to the iPhone/iPad app mac Anything specific to the Mac app labels Jan 4, 2021
@AngeloStavrow AngeloStavrow merged commit e3ddefa into main Jan 11, 2021
@AngeloStavrow AngeloStavrow deleted the add-button-accessibility-hints branch January 11, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios Anything specific to the iPhone/iPad app mac Anything specific to the Mac app
Development

Successfully merging this pull request may close these issues.

Icon-only buttons do not provide accessibility labels/hints
2 participants