From 432547b1d1699436497e91f1e9dfceea0b5f342a Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Tue, 23 Apr 2019 14:43:45 +0300 Subject: [PATCH 1/6] Enhance accessibility on toolbar buttons --- packages/block-library/src/image/edit.native.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 9ec571f55b56e0..26ebc5bf6c2a12 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -254,9 +254,10 @@ class ImageEdit extends React.Component { const toolbarEditButton = ( ); @@ -343,9 +344,10 @@ class ImageEdit extends React.Component { From 42658451d2bf11077a173d2994df453d9b25fc64 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Tue, 23 Apr 2019 14:45:38 +0300 Subject: [PATCH 2/6] Add accessibilityLabel for Image --- packages/block-library/src/image/edit.native.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 26ebc5bf6c2a12..0035e567c4bd67 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -379,6 +379,8 @@ class ImageEdit extends React.Component { resizeMethod="scale" source={ { uri: url } } key={ url } + accessible={ true } + accessibilityLabel={ __( 'Image' ) + __( '.' ) + ' ' + alt } > { this.state.isUploadFailed && From d0bd7d6fa9e47cca0d28aecab842ad06fe9b4504 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Tue, 23 Apr 2019 15:11:05 +0300 Subject: [PATCH 3/6] Add accessibility on caption --- packages/block-library/src/image/edit.native.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 0035e567c4bd67..4225a77e08de9e 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 @@ -394,7 +395,13 @@ class ImageEdit extends React.Component { } } { ( ! RichText.isEmpty( caption ) > 0 || isSelected ) && ( - + Date: Wed, 24 Apr 2019 11:36:47 +0300 Subject: [PATCH 4/6] Remove unnecessary hints --- packages/block-library/src/image/edit.native.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 4225a77e08de9e..94b14bf92e640e 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -258,7 +258,6 @@ class ImageEdit extends React.Component { title={ __( 'Edit image' ) } icon="edit" onClick={ onMediaOptionsButtonPressed } - extraProps={ { hint: __( 'Double tap to edit image' ) } } /> ); @@ -334,7 +333,6 @@ class ImageEdit extends React.Component { accessible={ ! isSelected } accessibilityLabel={ sprintf( '%s%s %s', __( 'Image block' ), __( '.' ), alt ) } accessibilityRole={ 'button' } - accessibilityHint={ __( 'Double tap to edit the image' ) } onPress={ this.onImagePressed } disabled={ ! isSelected } > @@ -348,7 +346,6 @@ class ImageEdit extends React.Component { title={ __( 'Image Settings' ) } icon="admin-generic" onClick={ onImageSettingsButtonPressed } - extraProps={ { hint: __( 'Double tap to open image settings' ) } } /> From e766c4e7b12ae274051dc32263120d5b44f70344 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Wed, 24 Apr 2019 11:39:40 +0300 Subject: [PATCH 5/6] Update accessibility labels --- packages/block-library/src/image/edit.native.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 94b14bf92e640e..427f496d1c801f 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -32,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'; @@ -331,7 +331,7 @@ class ImageEdit extends React.Component { return ( { this.state.isUploadFailed && From 1661d068696b44805403b2697025f534f6f84e76 Mon Sep 17 00:00:00 2001 From: Pinar Olguc Date: Wed, 24 Apr 2019 11:42:38 +0300 Subject: [PATCH 6/6] Remove unnecessary hint --- packages/block-library/src/image/edit.native.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/block-library/src/image/edit.native.js b/packages/block-library/src/image/edit.native.js index 427f496d1c801f..2646c5a58d64dd 100644 --- a/packages/block-library/src/image/edit.native.js +++ b/packages/block-library/src/image/edit.native.js @@ -396,7 +396,6 @@ class ImageEdit extends React.Component { style={ { padding: 12, flex: 1 } } accessible={ true } accessibilityLabel={ __( 'Image caption' ) + __( '.' ) + ' ' + ( isEmpty( caption ) ? __( 'Empty' ) : caption ) } - accessibilityHint={ __( 'Double tap to edit caption' ) } accessibilityRole={ 'button' } >