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

Mobile: Accessibility: Improve side menu and heading screen reader accessibility #11427

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/app-mobile/components/ScreenHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,12 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
const title = 'title' in this.props && this.props.title !== null ? this.props.title : '';
return (
<>
<Text ellipsizeMode={'tail'} numberOfLines={1} style={this.styles().titleText}>{title}</Text>
<Text
ellipsizeMode={'tail'}
numberOfLines={1}
style={this.styles().titleText}
accessibilityRole='header'
>{title}</Text>
{hideableAfterTitleComponents}
</>
);
Expand Down
7 changes: 4 additions & 3 deletions packages/app-mobile/components/side-menu-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ const SideMenuContentComponent = (props: Props) => {
} else if (folderIcon.type === FolderIconType.DataUrl) {
return <Image style={styles_.folderImageIcon} source={{ uri: folderIcon.dataUrl }}/>;
} else if (folderIcon.type === FolderIconType.FontAwesome) {
return <Icon style={styles_.folderBaseIcon} name={folderIcon.name} accessibilityLabel={''}/>;
return <Icon style={styles_.folderBaseIcon} name={folderIcon.name} accessibilityLabel={null}/>;
} else {
throw new Error(`Unsupported folder icon type: ${folderIcon.type}`);
}
Expand Down Expand Up @@ -485,6 +485,7 @@ const SideMenuContentComponent = (props: Props) => {
event.preventDefault();
void folder_longPress(folder);
}}
accessibilityHint={_('Opens notebook')}
role='button'
>
<View style={folderButtonStyle}>
Expand All @@ -500,7 +501,7 @@ const SideMenuContentComponent = (props: Props) => {
};

const renderSidebarButton = (key: string, title: string, iconName: string, onPressHandler: ()=> void = null, selected = false) => {
let icon = <IonIcon name={iconName} style={styles_.sidebarIcon} aria-hidden={true} />;
let icon = <Icon name={`ionicon ${iconName}`} style={styles_.sidebarIcon} accessibilityLabel={null} />;

if (key === 'synchronize_button') {
icon = <Animated.View style={{ transform: [{ rotate: syncIconRotation }] }}>{icon}</Animated.View>;
Expand All @@ -516,7 +517,7 @@ const SideMenuContentComponent = (props: Props) => {
if (!onPressHandler) return content;

return (
<TouchableOpacity key={key} onPress={onPressHandler} role='button'>
<TouchableOpacity key={key} onPress={onPressHandler} accessibilityRole='button'>
{content}
</TouchableOpacity>
);
Expand Down
Loading