Skip to content

Commit

Permalink
fix: only pass accessibility label if it is a string. fixes facebook#36
Browse files Browse the repository at this point in the history
  • Loading branch information
jpaas authored and satya164 committed Aug 18, 2019
1 parent acc4d92 commit bbe20db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/drawer/src/views/DrawerNavigatorItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ const DrawerNavigatorItems = ({
const scene = { route, index, focused, tintColor: color };
const icon = renderIcon(scene);
const label = getLabel(scene);
const accessibilityLabel = typeof label === 'string' ? label : undefined;
const extraLabelStyle = focused ? activeLabelStyle : inactiveLabelStyle;
return (
<TouchableItem
key={route.key}
accessible
accessibilityLabel={label}
accessibilityLabel={accessibilityLabel}
onPress={() => {
onItemPress({ route, focused });
}}
Expand Down

0 comments on commit bbe20db

Please sign in to comment.