Open roelvangils opened 3 years ago
@TriangleJuice As mentioned before, the Modal component codebase itself combined with the issues listed above would entice a complete rewrite of the modal component, (possibly) introducing breaking changes. However, rewriting this component should be rather easy, since functionality is very limited.
The Modal is not built with accessibility in mind. Some refactoring is required.
Erik and Roel reported back these issues (plus some recommendations).
SC 1.1.1 Non-text Content
SC 1.3.2 Meaningful Sequence
Fix: Is the heading always the name of the dialog? Either place the heading before the button visually and in code, or lower the heading a bit so the visual order is correct.
SC 3.1.2 Language of Parts
Recommendations
<body>
can be a good start. This makes it easy to put something likearia-hidden
on the rest of the DOM.aria-describedby
.<h4>
. Under what heading does this one fall in the hierarchy? I would suggest using an<h1>
.Role="dialog"
can set a screen reader in so-called application mode. Put arole="document"
on a wrapper of the content to prevent this.cursor: pointer
in CSS. The theory is that buttons should have enough affordance (we know we can click them) of their own, and pointers are for links. If you do put them on buttons, start thinking about (the design of) other components as well. Labels are also clickable, but don't always a get pointer.