Skip to content

form-control-has-label does not check children of siblings #924

Closed
@jashaj

Description

@jashaj

I have a checkbox with a label and extra description. To align the description with the label, I have wrapped them in a div:

<div class="checkbox">
  <input id="myCheckbox" type="checkbox" aria-describedby="myCheckboxInfo" />
  <div class="checkbox-label">
    <label for="myCheckbox">I agree</label>
    <p id="myCheckboxInfo">Here is some extra info what I agree upon</p>
  </div>
</div>

The plugin sees this as a violation of form-control-has-label even though there is a label/@for that refers to the id of the checkbox. The function hasLabelElement only checks the children of the parent but not their children.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions