dequelabs / dequelabs/axe-core

aria-sort not flagged on non-th elements without header role

Open
#5,019 3 comments 0 reactions 0 assignees View on GitHub
info needed
Dominant language
JavaScript
Stars
7.5k
Forks
933
Avg merge
2d 23h
Merged PRs (30d)
17

Description

### Product

axe-core

### Product Version

latest

### Latest Version

- [x] I have tested the issue with the latest version of the product

### Issue Description

**Description**

`aria-sort` should only be allowed on elements with role `columnheader` or `rowheader` (including native `th` with implicit header role).

However, axe-core does not flag cases where `aria-sort` is applied to non-`th` elements that do not have an explicit `rowheader` or `columnheader` role (e.g., `div`, `span`, `td` without appropriate role).

**Reproduction**

```html

Name

```

Expected: Violation reported (invalid use of `aria-sort`)
Actual: No violation reported.

**Reference**

For comparison, see this related unit test asserting correct `aria-sort` usage:
[https://github.com/evan90levesque-cmyk/Level_Access_Engine/blob/a37445427c317244d2145c67eae8618fb05115e5/src/Tests/Automatic/Test_14.js#L19](https://github.com/evan90levesque-cmyk/Level_Access_Engine/blob/a37445427c317244d2145c67eae8618fb05115e5/src/Tests/Automatic/Test_14.js#L19)

It explicitly validates that `aria-sort` is only used on elements with appropriate header roles.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.