ember-aria-utilities icon indicating copy to clipboard operation
ember-aria-utilities copied to clipboard

role="grid" is not a valid role

Open Alonski opened this issue 2 years ago • 3 comments

When upgrading an app using this addon the new Ember Template Lint rule no-redundant-role was autofixing code:

  <table
    role="grid"
    {{aria-grid}}
    class="w-full table-fixed {{if @isEmpty 'h-full'}}"
    data-test-selector="table"
  >

To:

  <table
    {{aria-grid}}
    class="w-full table-fixed {{if @isEmpty 'h-full'}}"
    data-test-selector="table"
  >

This causes the assertion that {{aria-grid}} can only be applied to elements with role="grid" to error locally and in tests.

Not sure what the fix is here. Locally I am going to disable this rule.

Alonski avatar Jun 21 '23 07:06 Alonski

Is this an ember-aria-utilities issue, or an ember-template-lint issue?

I'm not sure that role="grid" should be removed by ember template lint.

The implicit role for a table is "table", but any role is allowed (ref: https://www.w3.org/TR/html-aria/#docconformance), so I don't think role="grid" is redundant.

joelamb avatar Jun 21 '23 08:06 joelamb

Ok so maybe the rule is wrong?

Alonski avatar Jun 21 '23 08:06 Alonski

Yeah, the rule needs updating. The role is required here

NullVoxPopuli avatar Jun 21 '23 10:06 NullVoxPopuli