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

Native Image component includes outdated accessibility hint #45124

Open
dcalhoun opened this issue Oct 19, 2022 · 3 comments
Open

Native Image component includes outdated accessibility hint #45124

dcalhoun opened this issue Oct 19, 2022 · 3 comments
Labels
[Block] Image Affects the Image Block [Block] Media & Text Affects the Media & Text Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended

Comments

@dcalhoun
Copy link
Member

Description

When using a screen reader to navigate images in the native editor, an erroneous "Double tap and hold to edit" hint is read aloud. This discrepancy likely originates from #40651.

Step-by-step reproduction instructions

  1. Add an Image or Media & Text block.
  2. Add media to the block.
  3. Enable Voice Over.
  4. Move focus to the image.

Expected behaviour

An accurate hint is read aloud, e.g. "Double tap to view larger."

Actual behaviour

An inaccurate hint is read aloud: "Double tap and hold to edit."

Screenshots or screen recording (optional)

RPReplay_Final1666189917.MP4

WordPress information

  • WordPress version: 6.1
  • Gutenberg version: 14.3.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Geologist

Device information

  • Device: iPhone SE
  • Operating system: iOS 16
  • WordPress app version: 1.84.0
@dcalhoun dcalhoun added [Type] Bug An existing feature does not function as intended [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Block] Image Affects the Image Block [Block] Media & Text Affects the Media & Text Block labels Oct 19, 2022
@dcalhoun
Copy link
Member Author

I explored fixing this briefly, but paused as it was not completely clear if the label should be removed or updated. The a11y hint/state/action also appears to spread across the Image component and Image/Media & Text edit components. Both the Image and Media & Text edit components support various actions depending upon the state of the media, so we should likely have a dynamic accessibility hint.

onImagePressed() {
const { attributes, image } = this.props;
if ( this.state.uploadStatus === UPLOAD_STATE_UPLOADING ) {
requestImageUploadCancelDialog( attributes.id );
} else if (
attributes.id &&
getProtocol( attributes.url ) === 'file:'
) {
requestImageFailedRetryDialog( attributes.id );
} else if ( ! this.state.isCaptionSelected ) {
requestImageFullscreenPreview(
attributes.url,
image && image.source_url
);
}

onMediaPressed() {
const { isUploadInProgress } = this.state;
const {
mediaId,
mediaUrl,
mediaType,
isMediaSelected,
onMediaSelected,
} = this.props;
if ( isUploadInProgress ) {
requestImageUploadCancelDialog( mediaId );
} else if ( mediaId && getProtocol( mediaUrl ) === 'file:' ) {
requestImageFailedRetryDialog( mediaId );
} else if ( mediaType === MEDIA_TYPE_IMAGE && isMediaSelected ) {
requestImageFullscreenPreview( mediaUrl );
} else if ( mediaType === MEDIA_TYPE_IMAGE ) {
onMediaSelected();
}
}

@fluiddot
Copy link
Contributor

I explored fixing this briefly, but paused as it was not completely clear if the label should be removed or updated. The a11y hint/state/action also appears to spread across the Image component and Image/Media & Text edit components. Both the Image and Media & Text edit components support various actions depending upon the state of the media, so we should likely have a dynamic accessibility hint.

Good point @dcalhoun , it's true that the Image component depending on its state should provide different actions. Hence, I also lean towards implementing a dynamic accessibility hint depending on that. However, I'm wondering if we could do this in two steps:

  1. Update the hint to Double tap to view larger. to avoid confusion with the hold to edit message.
  2. Introduce dynamic accessibility hints that consider the media states.

WDYT?

@dcalhoun
Copy link
Member Author

@fluiddot yes, I agree it likely makes sense to fix the erroneous a11y first, then follow up with more robust, dynamic a11y labels.

@dcalhoun dcalhoun added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Block] Media & Text Affects the Media & Text Block [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants