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

fix(react): change div element to span in Icon component #795

Merged
merged 3 commits into from
Oct 10, 2022

Conversation

villet2
Copy link
Contributor

@villet2 villet2 commented Oct 4, 2022

fix(react): change div element to span in Icon component for better semantics.

When Icon component is used inside p tag it is not valid HTML, because Icon component uses div element. Replace div element with span, so the Icon can be used inside p tags and it is considered valid HTML.

Closes #668

…emantics.

When Icon component is used inside p tag it is not valid HTML, because Icon component uses div element.
Replace div element with span, so the Icon can be used inside p tags and it is considered valid HTML.

Closes dequelabs#668
@villet2 villet2 requested a review from a team as a code owner October 4, 2022 18:27
@anastasialanz anastasialanz self-assigned this Oct 5, 2022
@anastasialanz
Copy link
Contributor

The <span> is inline-block because of the .Icon class so nothing changes visually and the error message is gone. Looks good!

Screen Shot 2022-10-09 at 11 31 23 AM

@anastasialanz
Copy link
Contributor

Reviewed for security.

@anastasialanz anastasialanz enabled auto-merge (squash) October 9, 2022 17:56
@anastasialanz anastasialanz disabled auto-merge October 9, 2022 17:56
@scurker scurker merged commit 61754b2 into dequelabs:develop Oct 10, 2022
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.

Switch <Icon> components to use span instead of div for semantic HTML
3 participants