Hey friends, I initially wanted to post this as a GitHub issue, but it came out a bit too casual, so uhm, long post ahead.
I have seen enough accessibility issues during the week that my eyes are starting to bleed, and I thought I should share something.
Basically, we are building some UI components at work, and due to the complexity of the components, we decided to rely on a third-party library rather than building them from scratch. We found a library that almost matches our needs out of the box, but the lack of customization options blocks us from fulfilling our requirements. To beat the deadline, we had no choice but to fork the repo and adjust it ourselves. We found a few accessibility issues in the library during the research stage, but only when we started diving deep into the implementation, we were surprised at the actual amount of the issues, some of those are critical and will fail any basic audit.
They are mostly strange behavior in keyboard navigation pattern (let buttons do their job, don’t tabindex=-1
them), and the incorrect usage of HTML elements (<a>
is purely for links, not for actions). Anyway, we have been addressing these on our side to comply with our a11y requirements.
The week got worse for me as I stumbled upon this Ant Design issue. Please go ahead and read that first, I’ll wait. I recommend reading through the main issue the OP linked as well, but maybe after my post
Now, this got a bit personal to me, as the author, @zersiax, is the one that brought my attention to the importance of a11y (but he doesn’t know that). I think some of you remember, Florian helped freeCodeCamp with some a11y guides back then as well as reporting a11y issues he found; and I helped fix one or two of those.
My post here by no mean is to call out Ant Design. I have seen them being very proactive with a11y issues reported, but this particular one is huge, both in the severity and in what needs to be changed. I can imagine it will take a while for them to address this. But that’s not what I wanted to point out. What I wanted to say is, issues like this happen because a11y support is often missed in the technical planning phase, and by the time the implementation is complete, tech debt might already be built up that makes things hard to change, or the implementation approach doesn’t leave much room for modifications. This is something I am guilty of as well.
I would like to bring this up now so we can learn from that and keep a11y support a must-have criteria in our future updates. I for sure will try to keep the component library in check as best as I can, but there are a lot of other items I can do to help FCC with this.
I will occasionally spot check all FCC platforms, and I encourage everyone to do the same. I think I will report issues I find, and instead of fixing them myself, I will ask for contributions from others, especially first-time contributors, who are likely campers. This is a great way to get exposure to working with a11y support and make significant impact.
I do plan to write up a guide for the component library, which will include how to write meaningful unit tests. I can talk a lot more about this topic, but to keep things simple for now, going forward, we should try to use the React Testing Library’s ByRole
query in our tests, rather than looking for class name or element name (see the priority list here). There is also a great article for unit tests best practices by Kent C. Dodds.
The efforts should not stop here at FCC. I would ask everyone to help audit and fix a11y issues in other open source libraries as well, those that you have been using a lot and are more familiar with, or help Ant Design with the issue above.
As for the library I mentioned earlier, the decision to fork it leaves a bad taste in my mouth given how much I love the open source community (and what’s worse is that I am the one who made the decision). Our team has a plan to contribute the a11y fixes back to the library once our project is complete, so I think I will feel better then.
Hookay, this post is super long now. If you excuse me, I need to head to /r/aww for eyebleach.
Have a great weekend!