Skip to content

label: should check ariaLabelledByElements as well #4943

@woody-li

Description

@woody-li

Product

axe-core

Product Version

4.10.3

Latest Version

  • I have tested the issue with the latest version of the product

Issue Description

Expectation

Get ariaLabelledByElements value if possible for label value as well.

Actual

Only get aria-labelledby attribute, and don't parse ariaLabelledByElements value.

How to Reproduce

<p>Test label</p>
<input type="text" />
document.querySelector('input').ariaLabelledByElements = [document.querySelector('p')];

Additional context

When using custom element with shadow dom, it's the only way to refer to outer element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    coreIssues in the core code (lib/core)fixBug fixesrulesIssue or false result from an axe-core rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions