Force the back button to be recognized as such by screen readers. (#1155)

* Force the back button to be recognized as such by screen readers.

* Update HeaderBackButton.js

* Update HeaderBackButton.js

* Update HeaderBackButton.js

* Format remaining issues
This commit is contained in:
Aaron Cannon
2017-04-24 13:29:04 -05:00
parent 8eb384e4fe
commit 8e06b0f9fa
2 changed files with 10 additions and 5 deletions

View File

@@ -334,10 +334,10 @@ class CardStack extends Component {
});
const { options } = this._getScreenDetails(scene);
const gesturesEnabled = mode === 'card' && (
typeof options.gesturesEnabled === 'boolean' ? options.gesturesEnabled
: Platform.OS === 'ios'
)
const gesturesEnabled = mode === 'card' &&
(typeof options.gesturesEnabled === 'boolean'
? options.gesturesEnabled
: Platform.OS === 'ios');
const handlers = gesturesEnabled ? responder.panHandlers : {};

View File

@@ -67,11 +67,16 @@ class HeaderBackButton extends React.PureComponent<DefaultProps, Props, State> {
? this.state.initialTextWidth > width
: false;
const backButtonTitle = renderTruncated ? truncatedTitle : title;
// eslint-disable-next-line global-require
const asset = require('./assets/back-icon.png');
return (
<TouchableItem
accessibilityComponentType="button"
accessibilityLabel={backButtonTitle}
accessibilityTraits="button"
delayPressIn={0}
onPress={onPress}
pressColor={pressColorAndroid}
@@ -90,7 +95,7 @@ class HeaderBackButton extends React.PureComponent<DefaultProps, Props, State> {
style={[styles.title, { color: tintColor }]}
numberOfLines={1}
>
{renderTruncated ? truncatedTitle : title}
{backButtonTitle}
</Text>}
</View>
</TouchableItem>