question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google Lighthouse – [aria-*] attributes do not match their roles

See original GitHub issue

Hello,

I’m using multiple lottie players on the same webpage, and everything is working as expected (thank you for that). But as soon as I run Google Lighthouse, I’m getting the following error under “Accessibility”:

[aria-*] attributes do not match their roles Each ARIA role supports a specific subset of aria-* attributes. Mismatching these invalidates the aria-* attributes.

I’ve set up the lottie file as follows:

<lottie-player id='lottie-in-animation' ref={refLottieIn} mode='normal' controls={false} loop={false} description='Propeller circle' src={"/PATH_TO_JSON.json"} style={{ width: "100%", height: "100%" }}></lottie-player>

This renders all fine and creates a lottie player component with a shadow root that you can inspect in the devtools. That brings us to the aria-label issue that Google Lighthouse points out. I found out that this library supports the description attribute and creates an aria label of that property. If the description attribute is not filled in, it falls back to the text “Lottie animation”.

In my opinion, there is no need to add an aria-label to the <lottie-player> element, so my question is if that maybe can be disabled?

Thank you in advance and for all the work on this library – it’s great.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zheeengcommented, Jul 29, 2022

I encountered this problem when trying to raise my website score. Google Lighthouse reports the aria-label attribute mismatches the element’s role.

According to specifications, Lighthouse points to this element: <g aria-label="some text"></g>

1reaction
Nathan-deGraafcommented, Dec 16, 2021

Hi Guys, I recently reached out to the surpport staff, and this issue has been resolved. you can see the issue of an incorrect role being addressed in this following link!

Read more comments on GitHub >

github_iconTop Results From Across the Web

ARIA attributes do not match their roles on Canvas Toggle
It seems that the role attribute is missing where the ARIA attribute is used, and that might be the reason behind your issue....
Read more >
aria=* attributes do not match their roles in slick slider
I had this issue with <input type="number"> , which was a combobox - list of possible values appeared below the input and while...
Read more >
[aria-*] attributes do not match their roles - WordPress.org
I continue to see this error: https://snipboard.io/1Qtp9o.jpg when I test website with Lighthouse. [aria-*] attributes do not match their roles.
Read more >
Elements must only use allowed ARIA attributes | Axe Rules
Not all ARIA role-attribute combinations are valid. This Rule checks that each role is supplied with allowed attributes. The Algorithm (in simple terms)....
Read more >
When aria attributes do not match their roles - Seo Checker
When aria attributes do not match their roles · Users of assistive technologies, such as screen readers, need to know both the behaviour...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found