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

[patch] no-redundandant-roles: allow <img src="*.svg" role="img" /> #1026

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

lb-
Copy link
Contributor

@lb- lb- commented Oct 23, 2024

Setting role="img" is a valid use case to work around a Safari bug for better accessibility when the source image is an SVG file.

This improvement does not account for variables in the src attribute but adds a valid exception for when we can parse the string. In addition, add valid aria-role test for <svg role="img" /> to ensure no future conflicts arise.

Closes #936

lb- added 2 commits October 23, 2024 14:22
Setting role="img" is a valid use case to work around a Safari bug for better accessibility when the source image is an SVG file.
This improvement does not account for variables in the `src` attribute but adds a valid exception for when we can parse the string.
Fixes jsx-eslint#936
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems good (but is a patch, since it's reducing warnings)

@ljharb ljharb force-pushed the feature/936-role-img-svg-src branch 2 times, most recently from 4495c4c to fa9845d Compare October 25, 2024 23:21
@ljharb ljharb changed the title [feature] Improve no-redundant-roles to allow <img src="*.svg" role="img" /> [patch] no-redundandant-roles: allow <img src="*.svg" role="img" /> Oct 25, 2024
@ljharb ljharb changed the title [patch] no-redundandant-roles: allow <img src="*.svg" role="img" /> [patch] no-redundandant-roles: allow <img src="*.svg" role="img" /> Oct 25, 2024
@ljharb ljharb merged commit fa9845d into jsx-eslint:main Oct 25, 2024
112 checks passed
@lb-
Copy link
Contributor Author

lb- commented Oct 25, 2024

Thanks @ljharb

@lb- lb- deleted the feature/936-role-img-svg-src branch October 25, 2024 23:50
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

Successfully merging this pull request may close these issues.

2 participants