From edbe041e854313af198744c7c27242e023b74656 Mon Sep 17 00:00:00 2001 From: Michael Spaxman Date: Wed, 27 Jun 2018 02:12:18 +0200 Subject: [PATCH] fix(toolbar): give accessible name to sort and more actions button (#380) * fix(toolbar): give accessible name to sort button hide icons from screen readers use accessible names ensure accessible names appear for cursor navigation or rotor * [issue-379] make ariaLabels configurable with sensible defaults add optional ariaLabel property to ActionConfig set default text in case ariaLabel isn't present in action component add optional ariaLabel property to ToolbarView use ariaLabel if set in toolbar component, otherwise use tooltip * Update action-config.ts renamed ariaLabel as moreActionsAriaLabel since this is used only for the kebab button * Update action.component.html removed unlocalizable, default text --- src/app/action/action-config.ts | 5 +++++ src/app/action/action.component.html | 3 ++- src/app/filter/filter-fields.component.html | 4 ++-- src/app/sort/sort.component.html | 3 ++- src/app/toolbar/example/toolbar-example.component.html | 4 ++-- src/app/toolbar/toolbar-view.ts | 5 +++++ src/app/toolbar/toolbar.component.html | 7 +++++-- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/app/action/action-config.ts b/src/app/action/action-config.ts index 68ac23857..d2fc0cbec 100644 --- a/src/app/action/action-config.ts +++ b/src/app/action/action-config.ts @@ -10,6 +10,11 @@ export class ActionConfig { */ moreActions?: Action[]; + /** + * Text announced to screen readers for the action config button + */ + moreActionsAriaLabel?: string; + /** * Set to true to disable secondary actions */ diff --git a/src/app/action/action.component.html b/src/app/action/action.component.html index dfaf352da..ec6ac16f1 100644 --- a/src/app/action/action.component.html +++ b/src/app/action/action.component.html @@ -23,7 +23,8 @@ *ngIf="config.moreActions?.length > 0">