MiniCart Accessibility
Hi,
maybe I am missing a setting somewhere but it seems the minicart has no keyboard handling. So when you navigate to the minicart element via keyboard:
- Pressing ESC does not close the drawer (only click on the backdrop)
- when the drawer opens, focus is not moved into it.
- when you click outside, focus is not returned to the button that opened it
This matters for WCAG and the EU Accessibility Act.
Iβm currently working around it with a keydown listener calling window.fluentCartCart.closeModal(), but I think this should be in core.
Also - the mini cart button does nothing when the cart is empty. It seems that the cart element is not rendered until an item is placed into the cart. would be nice to have the option to show the cart even if it is empty. when you click the icon you expect something to happen (even if it just shows a "cart empty" message)
best,
Stefan
Hi Stefan,
Thanks for your report. Tab navigation and opening the mini-cart with Enter or Space work correctly. However, Escape-to-close, focus management, and focus restoration are not currently handled. Also, the drawer is not rendered when the cart is empty, so the button has nothing to open. Iβve forwarded these points to our development team for review as an accessibility improvement.
Thanks again.