Repository navigation
feat(aria): add role="img" to chart container element - #20050
Conversation
|
Thanks for your contribution! Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the |
Ovilia
left a comment
There was a problem hiding this comment.
I think 'img' should be a better value for role due to the definition.
The ARIA img role can be used to identify multiple elements inside page content that should be considered as a single image. These elements could be images, code snippets, text, emojis, or other content that can be combined to deliver information in a visual manner.
I agree. I will review it. |
| @@ -154,6 +154,7 @@ export default function ariaVisual(ecModel: GlobalModel, api: ExtensionAPI) { | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
Can we move the code here before checking description, so that it doesn't need to be set in two different situations?
|
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-20050@64539fe |
|
Congratulations! Your PR has been merged. Thanks for your contribution! π |
role="img" to chart container element
Brief Information
This pull request is in the type of:
What does this PR do?
Add role="region" on div tag when aria option is true to allow the aria-label property on the div
Fixed issues
#20034
Details
Before: What was the problem?
When aria option was true it would add aria-label to a div tag without a role. aria-label should only be added to interactive elements so it would fail Accessibility tests like Lighthouse's.
After: How does it behave after the fixing?
Now with role="region" the aria-label is allowed on the element.
Document Info
One of the following should be checked.
Misc
ZRender Changes
Related test cases or examples to use the new APIs
N.A.
Others
Merging options
Other information