Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility Mark I - Toolbar Buttons #793

Merged
merged 5 commits into from
Apr 3, 2019
Merged

Conversation

etoledom
Copy link
Contributor

@etoledom etoledom commented Mar 29, 2019

Part of #476

This is a simple PR that implements the changes made on WordPress/gutenberg#14697 to improve accessibility on the toolbar buttons.

To test (iOS):

  • Activate VoiceOver: https://github.com/wordpress-mobile/WordPress-iOS/wiki/Using-VoiceOver
  • Select the "Add Block" button.
  • Check that VoiceOver reads the label, that it reads the element type (button), and it reads the hint (after a couple of seconds).
  • Select the "Unod/Redo" buttons.
  • Check that it reads the label, the element type (button) and the state (dimmed)
    • For some reason it says dimmed instead of disabled, but it's a iOS system thing.
  • Select a Paragraph or Heading block.
  • Check that the format buttons are read correctly (label and type).
  • Activate one of the format buttons (b, i, ABC, H2, H3, or H4).
  • Check that the button state is read correctly (selected)
  • Select the Hide Keyboard button.
  • Check that it reads properly (label and type).

To test (Android):

  • Activate TalkBack: https://www.wikihow.com/Enable-TalkBack-on-Your-Android
    • In my case, the system had a handy tutorial on how to use it.
    • If your version doesn't have it, it's actually very similar to VoiceOver.
  • Select the "Add Block" button.
  • Check that VoiceOver reads the label, that it reads the element type (button), and it reads the hint (after a couple of seconds).
  • Select the "Unod/Redo" buttons.
  • Check that it reads the label, the element type (button) and the state (dimmed)

And that's it. On Android, blocks are still unusable by TalkBack :(

icon={ ( <Dashicon icon="plus-alt" style={ styles.addBlockButton } color={ styles.addBlockButton.color } /> ) }
onClick={ onInsertClick }
extraProps={ { hint: __( 'Double tap to add a block' ) } }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we talked with @JavonDavis , we will try to change this on a future PR and pass directly an accessibilityHint prop.
For now I prefer to keep it simpler.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why the hint is "double tap"? A single tap seems to be enough to execute the action here, is it not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When VoiceOver is active, a single tap will select an element, and a double tap will trigger the action. It's kind of standard for hints.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, indeed I needed to actually enable TalkBack to see it in action 👍

@etoledom etoledom mentioned this pull request Mar 29, 2019
4 tasks
Copy link
Contributor

@pinarol pinarol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks and works good ! 🎉
I could just test the WPiOS app(don't have an android device yet :( )

Copy link
Contributor

@Tug Tug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Android, LGTM 👍

@etoledom etoledom merged commit bbe03f8 into develop Apr 3, 2019
@etoledom
Copy link
Contributor Author

etoledom commented Apr 3, 2019

Thank you both!

@etoledom etoledom deleted the issue/accessibility-mark-i branch April 3, 2019 07:35
@hypest
Copy link
Contributor

hypest commented Apr 4, 2019

👋 @etoledom , I wonder if there are any guidelines we can extract at this point and add them to the Wiki for how the code of an accessible component should look. It can be a running/living document as we get better at this. WDYT?

@etoledom
Copy link
Contributor Author

etoledom commented Apr 4, 2019

@hypest - I have that in mind!

Not sure about best practices regarding gutenberg in specific, like where is best to add the accessibility related props (block files, controls, etc...), but there are more generics guidelines that I can definitely share right away, and we can improve them in the way.

I can do something similar to this: https://github.com/wordpress-mobile/WordPress-iOS/wiki/VoiceOver-guideline#when-to-and-when-not-to with a RN language. 👍

@hypest
Copy link
Contributor

hypest commented Apr 4, 2019

Sounds good, thanks @etoledom !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants