Skip to content

[control-has-associated-label]: Does not allow for custom components that would result in accessible labels #981

Open
@eddhurst

Description

@eddhurst

This rule doesn't support dynamic components that can't be statically analysed as providing a label, but would result in an accessible label at run time.

Specifically in my instance, the react-intl component <FormattedMessage /> takes the prop id and then results in the HTML structure

<span>Locale-aware content</span>

However, the control-has-associated-label has no way to be extended and accept an array of components that can be safely considered as providing a label.

Screenshot 2024-04-22 at 13 42 10

The config only allows for adding components that should be parsed by this rule, and allows for removing components that should be excluded, but doesn't allow for extending to match a given component that would then result in a pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions