I have a menu that's written like:
<ul>
<li><a href="#">Item 1</a></li>
<li aria-haspopup="true">
<a href="#">Item 2</a>
<ul aria-label="submenu">
<li><a href="#">Item 2-1</a></li>
<li><a href="#">Item 2-2</a></li>
<li><a href="#">Item 2-3</a></li>
</ul>
</li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 4</a></li>
I tested my site with the accessibility audit checker on accessibe.com and I was pulled that my submenu did not have aria-haspopup="true" on it.
My question is, should that attribute be on the <li> or <a>?
My thought is that it is the <li> that activates the hover menu on hover and on focus with both mouse and keyboard. Not the <a>. If this is correct then why is the getting flagged for not having it?