Commit 539da395 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Add `aria-label` where appropriate to `<button>` elements

parent 63559b98
......@@ -14,6 +14,7 @@ function ToolbarButton({ badgeCount, icon, label, onClick, shortcut }) {
<button
className="annotator-adder-actions__button"
onClick={onClick}
aria-label={title}
title={title}
>
{icon && <SvgIcon name={icon} />}
......
......@@ -70,6 +70,7 @@ function AnnotationPublishControl({
style={applyTheme(themeProps, settings)}
onClick={onSave}
disabled={isDisabled}
aria-label={`Publish this annotation to ${publishDestination}`}
title={`Publish this annotation to ${publishDestination}`}
>
Post to {publishDestination}
......
......@@ -119,6 +119,7 @@ function ToolbarButton({
)}
disabled={disabled}
onClick={onClick}
aria-label={tooltip}
title={tooltip}
tabIndex={tabIndex}
ref={buttonRef}
......
......@@ -148,6 +148,7 @@ export default function Menu({
className="menu__toggle"
onMouseDown={toggleMenu}
onClick={toggleMenu}
aria-label={title}
title={title}
>
<span
......
......@@ -51,15 +51,16 @@ function ModerationBanner({ annotation, api, toastMessenger }) {
};
const toggleButtonProps = (() => {
const props = {};
const buttonProps = {};
if (annotation.hidden) {
props.onClick = unhideAnnotation;
props.title = 'Make this annotation visible to everyone';
buttonProps.onClick = unhideAnnotation;
buttonProps.title = 'Make this annotation visible to everyone';
} else {
props.onClick = hideAnnotation;
props.title = 'Hide this annotation from non-moderators';
buttonProps.onClick = hideAnnotation;
buttonProps.title = 'Hide this annotation from non-moderators';
}
return props;
buttonProps['aria-label'] = buttonProps.title;
return buttonProps;
})();
const bannerClasses = classnames('moderation-banner', {
......
......@@ -239,6 +239,7 @@ function TagEditor({ onEditTags, tags: tagsService, tagList }) {
onClick={() => {
removeTag(tag);
}}
aria-label={`Remove Tag: ${tag}`}
title={`Remove Tag: ${tag}`}
className="tag-editor__delete"
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment