Skip to content

Commit

Permalink
fix: appBar Accessibility Focus (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
chewy444 authored and Trancever committed Jan 24, 2020
1 parent dc7b47e commit 2826d83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/Appbar/AppbarContent.tsx
Expand Up @@ -30,6 +30,10 @@ type Props = $RemoveChildren<typeof View> & {
* Style for the title.
*/
titleStyle?: StyleProp<TextStyle>;
/**
* Reference for the title.
*/
titleRef?: React.RefObject<Text>;
/**
* Text for the subtitle.
*/
Expand Down Expand Up @@ -62,6 +66,7 @@ class AppbarContent extends React.Component<Props> {
subtitleStyle,
onPress,
style,
titleRef,
titleStyle,
theme,
title,
Expand All @@ -78,6 +83,7 @@ class AppbarContent extends React.Component<Props> {
<TouchableWithoutFeedback onPress={onPress}>
<View style={[styles.container, style]} {...rest}>
<Text
ref={titleRef}
style={[
{
color: titleColor,
Expand All @@ -87,6 +93,7 @@ class AppbarContent extends React.Component<Props> {
titleStyle,
]}
numberOfLines={1}
accessible
accessibilityTraits="header"
// @ts-ignore
accessibilityRole={Platform.OS === 'web' ? 'heading' : 'header'}
Expand Down
Expand Up @@ -417,6 +417,7 @@ exports[`Appbar passes additional props to AppbarBackAction, AppbarContent and A
<Text
accessibilityRole="header"
accessibilityTraits="header"
accessible={true}
numberOfLines={1}
style={
Array [
Expand Down

0 comments on commit 2826d83

Please sign in to comment.