Skip to content

ElementInternals: Update the explicitLabel functions to support form associated labels #5045

@straker

Description

@straker

To support looking at form associated labels we'll need to update nativeTextAlternative to look for the internals.label or the internals.formAssociated properties along with the element spec. If we detect the property we then call labelText manually. Then we also update the getExplicitLabels function labelText uses to use the element from the internals.label directly if present, otherwise we continue to find it in the dom by id. This should be all that is required to allow the accessible text algorithm to handle form associated labels.

Any rules that define checks to look at implictLabel or explictLabel that affect custom input elements will not need to be updated since they already define looking at the labels to begin with. At the moment I don't think we have any such rules, but when converting rules to look at internal roles, the label rule (as well as other input like rules such as select-name) may fall under this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions