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

[Mobile]: Improving accessibility on Image Block (deselected) #14713

Merged
merged 14 commits into from
Apr 23, 2019
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ import styles from './styles.scss';

function MediaPlaceholder( props ) {
return (
<TouchableWithoutFeedback onPress={ props.onMediaOptionsPressed }>
<TouchableWithoutFeedback
accessibilityLabel={ __( 'Image block. Empty ' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we can reuse the 'Image block' string here. Image block. Empty as a whole does not make much sense for translators:

accessibilityLabel={ __( 'Image block' ) + '. ' + __( 'Empty' ) }

accessibilityRole={ 'button' }
accessibilityHint={ __( 'Double tap to select an image' ) }
onPress={ props.onMediaOptionsPressed }
>
<View style={ styles.emptyStateContainer }>
<Dashicon icon={ 'format-image' } />
<Text style={ styles.emptyStateTitle }>
Expand Down
9 changes: 8 additions & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,14 @@ class ImageEdit extends React.Component {
const progress = this.state.progress * 100;

return (
<TouchableWithoutFeedback onPress={ this.onImagePressed } disabled={ ! isSelected }>
<TouchableWithoutFeedback
accessible={ ! isSelected }
accessibilityLabel={ __( 'Image block' ) + '.' + alt }
Copy link
Contributor

Choose a reason for hiding this comment

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

It could use a space after the period:

__( 'Image block' ) + '. ' + alt

accessibilityRole={ 'button' }
accessibilityHint={ __( 'Doulbe tap to edit the image' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Doulbe => Double

onPress={ this.onImagePressed }
disabled={ ! isSelected }
>
<View style={ { flex: 1 } }>
{ showSpinner && <Spinner progress={ progress } /> }
<BlockControls>
Expand Down