Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
eddhurst opened this issue Apr 22, 2024 · 1 comment

Comments

@eddhurst
Copy link

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.

@ljharb
Copy link
Member

ljharb commented Apr 22, 2024

This is a duplicate of #863, i believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants