Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/visual/aria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) {
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the code here before checking description, so that it doesn't need to be set in two different situations?

if (labelModel.get('description')) {
dom.setAttribute('role', 'img');
dom.setAttribute('aria-label', labelModel.get('description'));
return;
}
Expand Down Expand Up @@ -241,6 +242,7 @@ export default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) {
const endSeparator = separatorModel.get('end');
ariaLabel += seriesLabels.join(middleSeparator) + endSeparator;

dom.setAttribute('role', 'img');
dom.setAttribute('aria-label', ariaLabel);
}
}
Expand Down