Skip to content

template-accessibility-label-for does not recognise nested custom control components. #811

@Merott

Description

@Merott

Describe the bug

I have a custom checkbox form control, with the selector x-checkbox, nested inside a label. Despite configuring controlComponents for template-accessibility-label-for, I still get this:

A form label must be associated with a control

This feels like I must be doing something wrong because it's a really basic use case...

Context and configuration

Rule configuration:

"template-accessibility-label-for": [
  true,
  {
    "controlComponents": ["x-checkbox"]
  }
]

Simplified Template code:

<label>
  <x-checkbox></x-checkbox>
  Check me
</label>

Environment

  • Version: 5.0.0
  • OS: macOS 10.14.4
  • Node.js version: 11.12.0
  • Yarn version: 1.15.2
  • Angular version: 7.2.11
  • tslint version: 5.14.0

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions