[CardActionArea] does not comply with the HTML5 specification #45130
Labels
accessibility
a11y
component: card
This is the name of the generic UI component, not the React module!
Steps to reproduce
Steps:
<div>
is placed inside a tag<button>
, which does not comply to HTML5's specificationProblem:
http://www.w3.org/TR/2012/WD-html5-20120329/the-button-element.html#the-button-element says that a
<button>
must contain only Phrasing content. Phrasing content is defined as including<span>
but not<div>
.Current behavior
<CardActionArea>
when rendered becomes a<button>
tag. If you add anything inside of it, e.g.<CardContent>
or<Box>
, it will happen that after rendering, you'll end up with a<button>
tag, that has<div>
inside of it.Expected behavior
All components from MUI should follow HTML5's validation rules, including
<CardActionArea>
.Context
I was using MUI's
<Card>
component, which had a<CardActionArea>
component inside of it, with child components, such as<CardHeader>
and<CardContent>
, then I published my website to the server and tried to check for any HTML validation errors on https://validator.w3.org, which showed me errors related to<Card>
component from MUI.Your environment
npx @mui/envinfo
Search keywords: W3C CardActionArea Card HTML5 SEO
The text was updated successfully, but these errors were encountered: