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
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gutenberg
10 changes: 6 additions & 4 deletions src/block-management/block-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class BlockToolbar extends Component<PropsType> {
} = this.props;

return (
<View style={ styles.container }>
<View style={ styles.container } >
<ScrollView
horizontal={ true }
showsHorizontalScrollIndicator={ false }
Expand All @@ -58,18 +58,19 @@ export class BlockToolbar extends Component<PropsType> {
>
<Toolbar>
<ToolbarButton
label={ __( 'Add block' ) }
title={ __( 'Add block' ) }
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 👍

/>
<ToolbarButton
label={ __( 'Undo' ) }
title={ __( 'Undo' ) }
icon="undo"
isDisabled={ ! hasUndo }
onClick={ undo }
/>
<ToolbarButton
label={ __( 'Redo' ) }
title={ __( 'Redo' ) }
icon="redo"
isDisabled={ ! hasRedo }
onClick={ redo }
Expand All @@ -81,6 +82,7 @@ export class BlockToolbar extends Component<PropsType> {
{ showKeyboardHideButton &&
( <Toolbar passedStyle={ styles.keyboardHideContainer }>
<ToolbarButton
title={ __( 'Hide keyboard' ) }
icon="keyboard-hide"
onClick={ this.onKeyboardHide }
/>
Expand Down