From 9db86a8113f5c398d51ca1dee16b2ef6b6890f10 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Wed, 24 Apr 2019 13:52:39 +0300 Subject: [PATCH] [Mobile]Improve accessibility on image block selected state (#15122) * Enhance accessibility on toolbar buttons * Add accessibilityLabel for Image * Add accessibility on caption * Remove unnecessary hints * Update accessibility labels * Remove unnecessary hint --- .../block-library/src/image/edit.native.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 9ec571f55b56e0..2646c5a58d64dd 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -13,6 +13,7 @@ import { requestImageFailedRetryDialog, requestImageUploadCancelDialog, } from 'react-native-gutenberg-bridge'; +import { isEmpty } from 'lodash'; /** * WordPress dependencies @@ -31,7 +32,7 @@ import { BottomSheet, Picker, } from '@wordpress/block-editor'; -import { __, sprintf } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { isURL } from '@wordpress/url'; import { doAction, hasAction } from '@wordpress/hooks'; @@ -254,7 +255,7 @@ class ImageEdit extends React.Component { const toolbarEditButton = ( @@ -330,9 +331,8 @@ class ImageEdit extends React.Component { return ( @@ -343,7 +343,7 @@ class ImageEdit extends React.Component { @@ -377,6 +377,8 @@ class ImageEdit extends React.Component { resizeMethod="scale" source={ { uri: url } } key={ url } + accessible={ true } + accessibilityLabel={ alt } > { this.state.isUploadFailed && @@ -390,7 +392,12 @@ class ImageEdit extends React.Component { } } { ( ! RichText.isEmpty( caption ) > 0 || isSelected ) && ( - +