-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Changes from 11 commits
6326cfd
6bf013d
2ab1249
578e508
4d7d23f
7b89592
928e5bb
3f3428d
14652d6
ab14bf8
048ffb7
5070a34
a40896b
2f7b128
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -328,7 +328,14 @@ class ImageEdit extends React.Component { | |
const progress = this.state.progress * 100; | ||
|
||
return ( | ||
<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 commentThe reason will be displayed to describe this comment to others. Learn more. the dot here can be localized also |
||
accessibilityRole={ 'button' } | ||
accessibilityHint={ __( 'Double tap to edit the image' ) } | ||
onPress={ this.onImagePressed } | ||
disabled={ ! isSelected } | ||
> | ||
<View style={ { flex: 1 } }> | ||
{ showSpinner && <Spinner progress={ progress } /> } | ||
<BlockControls> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,20 +14,21 @@ import { __ } from '@wordpress/i18n'; | |
*/ | ||
import styles from './editor.scss'; | ||
|
||
export default function NextPageEdit( { attributes } ) { | ||
const { customText = __( 'Page break' ) } = attributes; | ||
// Setting the font here to keep the CSS linter happy, it was demanding a syntax | ||
// 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 commentThe reason will be displayed to describe this comment to others. Learn more. This was creating an issue that disabled scrolling with VoiceOver active. |
||
}; | ||
export default function NextPageEdit( { attributes, isSelected, onFocus } ) { | ||
const { customText = __('Page break') } = attributes; | ||
const accessibilityTitle = attributes.customText || ''; | ||
const accessibilityState = isSelected ? [ 'selected' ] : []; | ||
|
||
return ( | ||
<View style={ styles[ 'block-library-nextpage__container' ] }> | ||
<Hr text={ customText } | ||
textStyle={ textStyle } | ||
lineStyle={ styles[ 'block-library-nextpage__line' ] } /> | ||
<View | ||
accessible | ||
accessibilityLabel={ __( 'Page break block' ) + '. ' + accessibilityTitle } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the dot here can be localized also |
||
accessibilityStates={ accessibilityState } | ||
onAccessibilityTap={ onFocus } | ||
> | ||
<Hr text={customText} | ||
textStyle={styles['block-library-nextpage__text']} | ||
lineStyle={styles['block-library-nextpage__line']} /> | ||
</View> | ||
); | ||
} |
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