-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
accessible={ ! isSelected } | ||
accessibilityLabel={ __( 'Image block' ) + '.' + alt } | ||
accessibilityRole={ 'button' } | ||
accessibilityHint={ __( 'Doulbe tap to edit the image' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doulbe
=> Double
@@ -16,7 +16,12 @@ import styles from './styles.scss'; | |||
|
|||
function MediaPlaceholder( props ) { | |||
return ( | |||
<TouchableWithoutFeedback onPress={ props.onMediaOptionsPressed }> | |||
<TouchableWithoutFeedback | |||
accessibilityLabel={ __( 'Image block. Empty ' ) } |
There was a problem hiding this comment.
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' ) }
<TouchableWithoutFeedback onPress={ this.onImagePressed } disabled={ ! isSelected }> | ||
<TouchableWithoutFeedback | ||
accessible={ ! isSelected } | ||
accessibilityLabel={ __( 'Image block' ) + '.' + alt } |
There was a problem hiding this comment.
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
…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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the dot here can be localized also
@@ -16,7 +16,12 @@ import styles from './styles.scss'; | |||
|
|||
function MediaPlaceholder( props ) { | |||
return ( | |||
<TouchableWithoutFeedback onPress={ props.onMediaOptionsPressed }> | |||
<TouchableWithoutFeedback | |||
accessibilityLabel={ __( 'Image block' ) + '. ' + __( 'Empty' ) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @etoledom 🎉
I think it'd be ok for me to approve since localization will be very simple and the extra accessibility label will be a part of selected version's PR
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.