From 43a29a9d0ff97bf99add56fc5b4acb39971d0fe5 Mon Sep 17 00:00:00 2001 From: Lindsey Bieda Date: Thu, 27 Apr 2017 06:01:36 -0400 Subject: [PATCH] Add aria-label to icon driven dropdown menus (#2516) --- .../components/components/dropdown_menu.jsx | 13 +++++++++---- .../components/components/status_action_bar.jsx | 2 +- .../features/status/components/action_bar.jsx | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/components/components/dropdown_menu.jsx b/app/assets/javascripts/components/components/dropdown_menu.jsx index fc05fcd2a..f5ee27a11 100644 --- a/app/assets/javascripts/components/components/dropdown_menu.jsx +++ b/app/assets/javascripts/components/components/dropdown_menu.jsx @@ -43,13 +43,13 @@ class DropdownMenu extends React.PureComponent { } render () { - const { icon, items, size, direction } = this.props; + const { icon, items, size, direction, ariaLabel } = this.props; const directionClass = (direction === "left") ? "dropdown__left" : "dropdown__right"; return ( - - + + @@ -67,7 +67,12 @@ DropdownMenu.propTypes = { icon: PropTypes.string.isRequired, items: PropTypes.array.isRequired, size: PropTypes.number.isRequired, - direction: PropTypes.string + direction: PropTypes.string, + ariaLabel: PropTypes.string +}; + +DropdownMenu.defaultProps = { + ariaLabel: "Menu" }; export default DropdownMenu; diff --git a/app/assets/javascripts/components/components/status_action_bar.jsx b/app/assets/javascripts/components/components/status_action_bar.jsx index a84cadcfe..044b3f964 100644 --- a/app/assets/javascripts/components/components/status_action_bar.jsx +++ b/app/assets/javascripts/components/components/status_action_bar.jsx @@ -108,7 +108,7 @@ class StatusActionBar extends React.PureComponent {
- +
); diff --git a/app/assets/javascripts/components/features/status/components/action_bar.jsx b/app/assets/javascripts/components/features/status/components/action_bar.jsx index bbdbf56e3..764d6646e 100644 --- a/app/assets/javascripts/components/features/status/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/status/components/action_bar.jsx @@ -75,7 +75,7 @@ class ActionBar extends React.PureComponent {
-
+
); }