What's wrong
Drawer carts, sliding mobile navigation panels, or modal dialogs that are closed often keep `aria-hidden="true"` while inner buttons remain in the tab order.
Who it affects
Keyboard navigators tab into invisible elements on the page while screen readers remain completely silent, causing disorientation.
How to fix on WordPress
In JavaScript mobile menu or modal scripts, add the `inert` attribute to closed off-canvas menus or toggle `display: none` when the drawer is collapsed.
Code example
Problematic Code
JAVASCRIPT
// Opening/closing mobile menu without managing inert
mobileMenu.setAttribute('aria-hidden', 'true');Recommended Accessible Code
JAVASCRIPT
// Correctly disable focus when off-canvas is closed
mobileMenu.setAttribute('aria-hidden', 'true');
mobileMenu.setAttribute('inert', '');
mobileMenu.style.display = 'none';How to check your fix
Close the drawer or modal, then press Tab repeatedly through the page. Verify that focus never lands on hidden links or buttons inside the closed panel.