Skip to content

Linter: Implement a11y-nested-interactive-elements rule #1222

Description

@marcoroth

Implement the GitHub::Accessibility::NestedInteractiveElements rule from erblint-github.

Rule Details

Certain interactive controls such as button, summary, input, select, textarea, or a can't have interactive children. Nesting interactive elements produces invalid HTML, and assistive technologies, such as screen readers, might ignore or respond unexpectedly to such nested controls.

Examples

Incorrect code for this rule:

<button>
  <a href="https://github.com/">Go to GitHub</a>
</button>

Correct code for this rule:

<button>Confirm</button>

References

Parent Issue

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions