๐ฅ Who is affected
Screen reader users (NVDA, JAWS, VoiceOver) and keyboard-only users. Screen readers often ignore the inner interactive element or fail to announce its role, and keyboard focus may skip the inner element entirely.
๐งโ๐ฆฏ User experience
I Tab to the 'Jess Lee profile details' button, but I cannot reach the specific link or button hidden inside it. When I press Enter, the outer button triggers, but I have no way to activate the inner control, leaving me unable to access the specific action I need.
โ ๏ธ Why it matters
This is a violation of WCAG 4.1.2 (Name, Role, Value) and 2.1.1 (Keyboard). Legally, it creates a significant accessibility barrier; practically, it renders nested functionality unreachable for anyone not using a mouse.
๐ง How to fix
1. Remove the inner interactive element from inside the outer button. 2. Restructure the HTML so that the interactive elements are siblings (placed next to each other) rather than nested. 3. Use CSS positioning or a wrapper div to maintain the desired visual layout without nesting interactive roles.
๐ป Code example
Before
<a href="/profile/jess-lee">
<button id="story-author-preview..." aria-controls="story-author-preview..." class="profile-preview-card..." aria-label="Jess Lee profile det..." aria-expanded="false" aria-haspopup="true" data-dropdown-initia...="true" data-initialized="true">Jess Lee</button>
</a>
After
<div class="profile-preview-container">
<button id="story-author-preview..." aria-controls="story-author-preview..." class="profile-preview-card..." aria-label="Jess Lee profile det..." aria-expanded="false" aria-haspopup="true" data-dropdown-initia...="true" data-initialized="true">Jess Lee</button>
</div> <!-- Removed wrapping anchor tag to resolve nested-interactive violation -->