Skip to content

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

2 participants