S6819 Prefer tag over role is misleading

  • What language is this for? JS/TS/React
  • Which rule? S6819 Prefer tag over ARIA role
  • Why do you believe it’s a false-positive/false-negative?
    Quoting from ARIA: table role - Accessibility | MDN
    The table value of the ARIA role identifies … similar to the native HTML element. Therefore using some other component does not conflict with the role attributes specification

    Using a component framework that has a table implementation, which does not have the aria role set can be enriched with that specific attribute. Since there is no sensible way to disable a rule for a single line, let alone for a specific rule, in JS/TS/React, the only way around is disabling the rule

Hi,

Thanks for this report. Unfortunately, I’m not quite following it. Can you provide a code sample to demonstrate where an issue is raised and should not be?

 
Thx,
Ann

We are using UI5 React, the React reference implementation of SAP Fiori, which is a UI components library. They provide a table implementation with a lot of features, but do not set the ARIA role on any (most anyways) of their components, in that case it isnt set on that table. To enrich this component with accessability we want to set the attribute, which raises the error. This table complies to the aria role table as per specification.

We can not change the component library and not using a HTML table element does not necessarily invalidate the aria role definition, therefore making it necessary to manually set the role=‘table’ attribute

<AnalyticalTable role={‘table’} from @ui5/webcomponents-react - npm

1 Like

Hi,

Thanks for the detail. I’ve flagged this for the language experts.

And a code sample would still be helpful.

 
:smiley:
Ann

Hi @gitgdako,

Thanks for bringing this up! Sorry for the huge delay.

Currently, we don’t have extensive support for SAP UI5 React, although we’ve heard a few users ask for it. I added your voice for future consideration :slight_smile:

Anyway, I think this could be a false positive for other UI component libraries too so I created a ticket:

Kinds regards,