[Mobile]: Improving accessibility on Image Block (deselected)#14713
[Mobile]: Improving accessibility on Image Block (deselected)#14713
Conversation
| accessible={ ! isSelected } | ||
| accessibilityLabel={ __( 'Image block' ) + '.' + alt } | ||
| accessibilityRole={ 'button' } | ||
| accessibilityHint={ __( 'Doulbe tap to edit the image' ) } |
| return ( | ||
| <TouchableWithoutFeedback onPress={ props.onMediaOptionsPressed }> | ||
| <TouchableWithoutFeedback | ||
| accessibilityLabel={ __( 'Image block. Empty ' ) } |
There was a problem hiding this comment.
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' ) }
| <TouchableWithoutFeedback onPress={ this.onImagePressed } disabled={ ! isSelected }> | ||
| <TouchableWithoutFeedback | ||
| accessible={ ! isSelected } | ||
| accessibilityLabel={ __( 'Image block' ) + '.' + alt } |
There was a problem hiding this comment.
It could use a space after the period:
__( 'Image block' ) + '. ' + alt
…ordPress/gutenberg into rnmobile/accessibility-mark-ii
|
Thank you for the review @Tug ! |
For some reason, VoiceOver wouldn't scroll down the block list. The breaking change was located at the removal of this css property `font-family: $default-regular-font;` on the nextpage block. Addinb back that property to be able to scroll the blocks list again using VoiceOver.
| // that React Native wasn't able to handle (adding a fallback generic font family). | ||
| const textStyle = { | ||
| ...styles[ 'block-library-nextpage__text' ], | ||
| fontFamily: 'System', |
There was a problem hiding this comment.
This was creating an issue that disabled scrolling with VoiceOver active.
I'm not sure the specific reason, but rolling back this change fixed the issue.
| <TouchableWithoutFeedback onPress={ this.onImagePressed } disabled={ ! isSelected }> | ||
| <TouchableWithoutFeedback | ||
| accessible={ ! isSelected } | ||
| accessibilityLabel={ __( 'Image block' ) + '. ' + alt } |
There was a problem hiding this comment.
the dot here can be localized also
| return ( | ||
| <TouchableWithoutFeedback onPress={ props.onMediaOptionsPressed }> | ||
| <TouchableWithoutFeedback | ||
| accessibilityLabel={ __( 'Image block' ) + '. ' + __( 'Empty' ) } |
There was a problem hiding this comment.
the dot here can be localized also
| <View style={ styles[ 'block-library-nextpage__container' ] }> | ||
| <View | ||
| accessible | ||
| accessibilityLabel={ __( 'Page break block' ) + '. ' + accessibilityTitle } |
There was a problem hiding this comment.
the dot here can be localized also
|
I've tried adding accesibility label for Image itself also, I think it felt better to be able to hear the image info independent from its selected state. |
|
Thank you! |
* Adding accessibility properties to MediaPlaceholder and ImageEdit * Fix lint issues * Fix typo * Better accessibility labels * Disable lists. (#14844) * Fix scroll with VoiceOver ON. For some reason, VoiceOver wouldn't scroll down the block list. The breaking change was located at the removal of this css property `font-family: $default-regular-font;` on the nextpage block. Addinb back that property to be able to scroll the blocks list again using VoiceOver. * Setting accessibilityStates properly to avoid Android crash * Remove vscode settings file (added by mistake) * Fix lint issues * Update accessibility labels to use sprintf * Fix lint issues
This PR improves accessibility on the Image Block.
To test:
Please refer to the gutenberg-mobile side PR.