Skip to content

Commit

Permalink
feat: support accessibility label for Snackbar button (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 authored and Trancever committed Mar 25, 2019
1 parent 00457a9 commit 2124a81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Props = {|
*/
action?: {
label: string,
accessibilityLabel?: string,
onPress: () => mixed,
},
/**
Expand Down Expand Up @@ -229,6 +230,7 @@ class Snackbar extends React.Component<Props, State> {
</Text>
{action ? (
<Button
accessibilityLabel={action.accessibilityLabel}
onPress={() => {
action.onPress();
onDismiss();
Expand Down
1 change: 1 addition & 0 deletions typings/components/Snackbar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface SnackbarProps {
visible: boolean;
action?: {
label: string;
accessibilityLabel?: string;
onPress: () => any;
};
duration?: number;
Expand Down

0 comments on commit 2124a81

Please sign in to comment.