My Heart Is In the Right Place, but the DOM Isn't

This ad is not shown to multipass and full ticket holders
JSNation US
JSNation US 2025
November 17 - 20, 2025
New York, US & Online
See JS stars in the US biggest planetarium
Learn More
In partnership with Focus Reactive
Upcoming event
JSNation US 2025
JSNation US 2025
November 17 - 20, 2025. New York, US & Online
Learn more
Bookmark
Project website
Rate this content

An enthusiastic look at some real-life horror stories of accessibility gone wrong. Learn accessibility best practices by examining cases where some people (myself included) built the right things the wrong way. Some customers were simply confused, while others literally became nauseous of what was built. Come learn from (my) mistakes while having a good laugh.

This talk has been presented at React Summit 2025, check out the latest edition of this React Conference.

FAQ

Translating ARIA labels is important because not all screen reader users speak your language, and translations ensure accessibility for diverse users.

The prefers-reduced-motion media query helps developers create web experiences that accommodate users with vestibular disorders by reducing animations that could cause dizziness or nausea.

Kyle West is a web engineer and accessibility lead for Family Search, co-authoring their design systems React library.

Kyle West's main responsibility is co-authoring the design systems React library, ensuring accessibility and usability across Family Search's products.

The phrase 'No ARIA is better than bad ARIA' means that improperly implemented ARIA (Accessible Rich Internet Applications) attributes can harm accessibility more than having no ARIA attributes at all.

'Potato code' is a term used by Kyle West to describe a piece of code that should not have passed code review, like an unintended hardcoded ARIA label that confuses screen readers.

Developers can avoid 'potato code' by conducting thorough code reviews, ensuring everyone understands accessibility best practices, and testing code appropriately.

You can find more information or contact Kyle West via Blue Sky or LinkedIn under KyleWestCS, or visit his website at kylewest.dev/slides.

Kyle West learned that adding tabindex to every element does not enhance accessibility and that understanding best practices is essential for creating accessible web experiences.

Inclusive acceptance tests are important because they ensure that accessibility features are maintained over time, preventing regressions that can negatively impact user experience.

Kyle West
Kyle West
18 min
17 Jun, 2025

Comments

Sign in or register to post your comment.
Video Summary and Transcription
Kyle West emphasizes the importance of building accessible products and shares experiences in ensuring accessibility. A focus on accurate ARIA labels and the impact on accessibility. Optimizing accessibility with proper labels and utilizing the aria-hidden attribute. Lessons in ARIA usage, tabindex attribute, and the importance of quality code reviews. Addressing vestibular disorders in web design with solutions like prefersReduceMotion media query. Enhancing user comfort with accessibility queries and the importance of inclusive user-centric design in product development.

1. The Importance of Accessibility in Web Development

Short description:

Kyle West, web engineer and accessibility lead, emphasizes the importance of building accessible products. Sharing experiences and challenges faced in ensuring accessibility, including an interesting anecdote about 'potato code' encountered during a user interaction.

Hello, everyone. My name's Kyle West. I'm a web engineer and accessibility lead for Family Search. The title of my talk is My Heart is in the Right Place, but the DOM Isn't. One of my primary roles is that I co-author our design systems React library, which is used heavily throughout our products. As an author of a core system that is used by most of our, almost all of our users, I've always felt an added sense of responsibility for building an accessible product that's available to everyone. This has often led me to the ARIA authoring practices guide, which is provided by W3C. It's a wonderful resource for anyone who's trying to build a product that fits industry best practices.

If you've been there before, you'll have no doubt have seen this banner up at the top, which reads, No ARIA is better than bad ARIA. They have a wonderful link that we could go click on and read together if we wanted, but it's very logical and totally explains why that's important. But I've learned from more than documentation. I've had my own life experiences. Throughout my time, I've seen many times in which myself and others have tried to do the right thing, but didn't do it well enough to be effective. I have about three of those stories I'd like to share with you.

The first one to start us off, you've probably heard of spaghetti code and likely with it ravioli code, but you probably have not heard of potato code, which is the title of my first story. To give some context, one thing I do is I meet periodically with some of my blind patrons to understand what their experience is like and identify any issues that they might be facing, elicit feedback. I meet periodically with them. One time, I was meeting with a woman who herself is blind. She works in our support department and she often takes the calls for other blind patrons. That week, she had noticed something that was a little bit off from what she was expecting, and so she wanted to show us what the issue was.

If you're unfamiliar, the way in which a blind user interfaces with a computer is through a tool called a screen reader, which takes the graphical information displayed on screen and then reads it aloud to the user. Then the user has an elevated set of keyboard shortcuts that let them navigate the page. In other words, instead of you yelling at the computer, the computer now yells at you. Well, for this particular case, the issue that our user had found was on a page that looks something like this. It has a heading at the top with some high details about the information on the page, and then a series of main cards containing all sorts of important information, and then a series of smaller sidebar with some smaller card widgets that perform certain related actions to the page. The issue that she wanted to point out to us was at the very bottom of the sidebar section, and as she was navigating to that portion of the page, along the way, about halfway through the sidebar, the screen reader said something that we found very intriguing. It said, Link potato. She just skipped over it like it wasn't a big deal. We said, wait, wait, wait, go back. Did you say potato, or did the screen reader say potato? She said, yeah, it did.

2. The Impact of Accurate ARIA Labels

Short description:

Exploring the concept of 'potato code' in web development, highlighting the importance of accurate ARIA labels and the impact on accessibility.

When people ask me about it, I've been telling them that it's not really a potato. It's just a character or something that our screen reader doesn't understand, and so it just gets confused and says potato. But it's not really a potato, so they can just ignore it. Bless her. She had so much trust in us, the engineers, that she assumed that it was the screen reader that was the problem and not our code.

Well, I don't really trust our code that much, so I went and tried to find this immediately. It didn't take me very long to get to this little gem where, as you can see, someone had hardcoded ARIA label of potato onto an icon. If you're unfamiliar, ARIA label is a special attribute that the screen reader uses for us to be able to say, hey, for this portion of the DOM, use the given value to describe it.

So when we got to there with the screen reader, it said potato, which is not really ideal for the situation since it obviously wasn't a potato. Most of the time, an ARIA label is a good thing to have, but in our case, it was just put there superfluously, which gives me the definition of what I now call potato code, which is code that should have never made it past a code review. This is a prime example of no ARIA is better than bad ARIA.

3. Optimizing Accessibility with Proper Labels

Short description:

The importance of providing accurate labels on icons and images for accessibility, including using legitimate values and translating labels for multilingual support. Utilizing aria-hidden attribute for decorative elements and ensuring visual text proximity for proper accessibility.

It turns out that one of my close friends, he's the one that wrote this, and had he had done nothing, the screen reader would have simply read this as an unlabeled graphic and then moved on, but no, my friends heard me talk over and over about accessibility and that it's important that we put appropriate labels on icons and images, and so he said to himself, essentially, I don't know what to put here right now, but I'll come back to it later, and then he went along and finished what he was working on, but forgot to come back. A junior dev did the review, it got merged, and then it went on its merry way to patrons.

Luckily, this is a pretty easy fix. The first option we have is to simply provide a legitimate value for the label. This way, the user can, when they navigate to it, they know its relevance and that the screen reader is able to communicate that to the user. You should know, though, that not all screen reader users speak your language, so one tip I have is to make sure that you're translating your labels if your site supports more than one locale. Just to make sure that it's understandable by all the people using your website.

Another option, and this is the one that I think we ended up going with, was to use an attribute called aria-hidden, and in case you aren't aware, aria-hidden is an attribute that tells the screen reader, hey, this portion of the DOM, you can just ignore it for whatever reason, and so the screen reader will just skip over it. This is appropriate to use in cases where the provided element doesn't give any additional value to the page, typically for a decorative purpose, and that's what it was in this case. The appropriate label we might have put on the icon was actually already said in the DOM right next to the icon. It would have been a sibling, and that was already in visual text, and so we decided to hide the icon since it was all inside of a link.

4. Lessons in ARIA Usage and Tabindex Attribute

Short description:

Lessons on using ARIA appropriately, translating labels for multilingual support, hiding decorative elements for accessibility, and the importance of quality code reviews. The story of discovering Tabindex attribute for keyboard accessibility.

The link was already being labeled with the visual text, which is totally appropriate. I have some lessons learned from this experience. The first one, as this is my intuitive learning of no aria is better than bad aria, had my friend done nothing, then it would have been less confusing than having a random potato in the DOM. Another lesson that's just a good thing that we covered today was that if your product is designed to support more than one locale, make sure that you're translating it. Any labels that you put on, again, because not all people speak your language, and even those that have a need for using a screen reader.

Then it's okay to hide decorative elements if they provide just simple visual value, but nothing that's semantic or necessary to understand your page. Lastly, my advice is that you can avoid potato code by having quality code reviews. It looks good to me. That rubber stamp is not really appropriate for all situations, especially ones that are not understood by everyone. This is a good thing to make sure that you're reviewing and testing your code appropriately.

My next story, I'm calling it Tabindex Everywhere. It takes place at the very beginning of my career back when I was straight out of college, and I didn't know what best practices were. I didn't know about screen readers, that they were a thing, or anything about the APG or WCAG or all that. All I knew was how to write lots and lots of code fast, and that's not always a good thing. One day, I got a bug ticket. It said something defective. We've been getting reports that some patrons have been unable to use the keyboard to navigate on this page, and then a link to the experience. Cool.

5. Misguided Use of Tabindex Attribute

Short description:

Discovering the misuse of Tabindex attribute, its impact on keyboard accessibility, and the consequences of unreviewed changes.

Well, I didn't really know what that meant. All I really saw were the words keyboard and navigate, and so I decided to do my own research. I went to my favorite browser. I typed in some garbage to see what would pop up, and then I found this. The first thing that popped up was Tabindex, and it sounded like exactly what I needed. You mean to tell me that there's a magic attribute that if I put on any DOM element, it'll make a keyboard focusable? Cool.

So I did. That sounded like what I needed. I did what any junior programmer who's highly prolific would do. I spent the next sprint putting it on everything. I put it on all the headings. I added it to every paragraph. I put it on list items. I added it to cards. I made every part of a table focusable, and I put it on buttons and links, which already come with Tabindex, by the way. I was just being safe, I guess.

To make sure that my solution continued to work, I made a series of tests to just solidify it. Then I put it out for code review. Now, if it's not clear already, this was a bad idea made by someone who was well-meaning but knew nothing about what he was doing. It's a terrible misguided effort. Tabindex is not accessibility. Actually, my friend sitting next to me was the one who did the code review, and I distinctly remember him leaning over the desk and just looking down at me and saying, Kyle, are you sure about this? Are you sure this is the way that we can make things keyboard navigable?

I just looked up at him and I said, yeah, I think so. He didn't contest me on it. Because he was also a junior, it got merged. Another potato into the ether, if you will. But no need to worry. It wasn't a big potato. It just happened to be that this was on a part of our site that was during a beta period, so our early adopters found it. It eventually ended up getting reverted, and the only thing that was really lost was my team's time. Still not a good thing to have, though.

6. Importance of Research in Accessibility

Short description:

Realizing the importance of proper research and adherence to accessibility best practices to avoid building confusing and difficult-to-navigate products.

What I should have done instead was I should have done more than merely five minutes of research. I'd like to imagine that had I done that, I would have eventually stumbled upon the authoring practices guide. As you can see from the screenshot, it has so many details about the proper ways to implement accessible features into your products, including descriptions on keyboard support with code examples. This is what I should have been looking at, not the first coding help subreddit post that popped up.

So my lessons learned from this experience, again, this solidified in my personal history, no ARIA is better than bad ARIA. What I built was very confusing and more difficult to navigate than had I just done nothing. In hindsight, it would have been better off for the user if I would have just been lazy and lied about fixing the bug than had I done what I did. I'm not encouraging anyone to lie about your work, you should be honest. But that's how bad of an experience it was, not just for maintainability, but actually going through it.

The real best practice from this, though, to me, is that I needed to familiarize myself with the best practices. And that includes the reviewer, too. Both as the coder and the reviewer, we have a responsibility to make sure that our users understand or that we understand what an accessible experience is for our users. We need to make sure that we're doing things the right way. Like guessing isn't a viable, feasible option. We need, there are plenty of real resources to help us and we should be relying on those.

7. Addressing Vestibular Disorders in Web Design

Short description:

Addressing the impact of animations on users with vestibular disorders and the solution through prefersReduceMotion media query and useReduceMotion hook.

This last story is a little bit more serious, if you can't tell from my title, don't make me throw up. At this point in my career, we had been doing accessibility work for a long time. There was a lot of great efforts that were done. Of course, there were plenty of work to still do and a lot of bugs. But overall, the big problems had been solved and I was comfortable with that.

I was feeling like we were in a really great spot. Then one day I got a message that made my heart sink. This was from a patron. And what they wrote was, the problem is that I can't spend hardly any time using the website because it nauseates me. The animations make me dizzy. Please get rid of them. I beg you.

I knew immediately what was wrong. This patron has, probably has, what you would call a vestibular disorder, which is a pretty complex situation. But essentially, what happens is that they're very sensitive to movement and parallax effects and even high contrast colors. Essentially, what's going on is that your visual information that your body's receiving conflicts with the other sensory, in particular, the information coming from your inner ear. Your brain thinks something's wrong, and it makes you nauseous, it might make you throw up.

8. Enhancing User Comfort with Accessibility Queries

Short description:

Exploring prefersReduceMotion media query, useReduceMotion hook, and the importance of accessibility queries for user comfort and prolonged website engagement.

If you ever experienced motion sickness, like through riding in a vehicle, then you've experienced a vestibular dysfunction. A vestibular disorder, they experience similar feelings but all the time. Not very fun. Luckily, most browsers support a media query called prefersReduceMotion. This exposes the operating system's accessibility preferences so that we can cater to them and adjust our animations as we need to.

The thing was that it surprised me that I got this letter, though, because I thought I'd already fixed this problem. A while ago, we had written code that looked something like this that told our animation library, we use React Spring, it's a pretty great library if you're unfamiliar with it. We were telling the animation library just to skip the animations if the user did prefer reduce motion. This worked when we merged it. But most code eventually regresses, and over time, we lost it. We didn't have sufficient acceptance tests for this particular feature. It ended up slipping through the cracks and eventually made it out to users in a broken state.

Luckily for us, in between the time of it breaking and us learning about it, React Spring had reduced a new hook called useReduceMotion that did exactly what we needed it to, and it works flawlessly. We put that in, and it's been great ever since. For FYI, for your information, there are several kinds of these queries that you could use. You've probably used the prefers color scheme if you've ever implemented a theme for your application. Not many people think of that as an accessibility issue, but it's making the website more comfortable.

Accessibility is just usability for more people. The more comfortable we can make our website, the longer users are going to spend on it, and the better they are off for it. These aren't even all of them, by the way. It's just what I wanted to fit on the slide. We know about prefersReduceMotion together here. There's also contrast and transparency that you can make queries for and be able to make the experience more comfortable. You don't have to use all of them for all experiences, but making it better off for your user is never a bad thing. We're now prepared, as far as lessons learned, to amend our mantra for the day, which is that no ARIA is better than bad ARIA, except if you do nothing and it makes your users throw up.

9. Inclusive User-Centric Design

Short description:

Highlighting the importance of inclusive acceptance tests, user comfort, and the impact of human-centric design in product development.

It's generally considered bad practice to have your users associate feelings of nausea with your product. It's not really good for business. We can honor our DOS preferences to avoid that. If we do so, the users, again, can spend more time on the website, and then all the benefits that come from that.

The biggest lesson I learned from this is that I needed to have more inclusive acceptance tests. Had we caught it earlier, it would have been better off. The user would have never gotten nauseous from using our product, hopefully. Then we could have avoided the whole situation had we just had better tests.

Sorry, by the way, if that was you. I feel bad that we ever got to that point. Well, that's about all the time that I have for stories today, but I wanted to leave you with this quote. It's from one of my personal heroes, Fred Rogers. He said that human beings are far more wonderful than machines. To me, this is a reminder that human life is incredibly unique, and that's what makes it beautiful.

There are a lot of people whom the world is not built for them, and they have to live in it anyway. Please consider the potential that you have to show love to others and reduce people's burdens, at least in the interactions that they have with your products. You have a tremendous capacity to do good here, so please do. Thank you so much. Again, my name is Kyle West. You can find me on Blue Sky or LinkedIn under KyleWestCS. You can also find these slides on my website, kylewest.dev, slash slides. Thank you again. It's been a pleasure. Appreciate you.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Accessibility at Discord
React Advanced 2021React Advanced 2021
22 min
Accessibility at Discord
This Talk discusses the accessibility efforts at Discord, focusing on keyboard navigation and the challenges faced with implementing focus rings and outlines. The speaker showcases a unified focus ring system and a saturation slider to address accessibility concerns. They also highlight the implementation of role colors and the use of CSS filters for accessibility improvements. The Talk concludes with insights on runtime accessibility checking and the development of a performant core runtime system for checking accessibility issues.
Configuring Axe Accessibility Tests
TestJS Summit 2021TestJS Summit 2021
30 min
Configuring Axe Accessibility Tests
Top Content
AXe is an accessibility engine for automated web UI testing that runs a set of rules to test for accessibility problems. It can be configured to disable or enable specific rules and run based on tags. Axe provides various options, but axe linter does not support all options. The importance of investing time and resources in accessibility is emphasized, as it benefits not only those with disabilities but improves the web for everyone. Manual testing is also highlighted as a necessary complement to automated tests for addressing accessibility issues.
Nested Interactive Elements: An Nightmare in Accessibility
React Advanced 2023React Advanced 2023
23 min
Nested Interactive Elements: An Nightmare in Accessibility
Top Content
Watch video: Nested Interactive Elements: An Nightmare in Accessibility
Nested interactive elements can cause accessibility issues on websites, and the speaker shares a personal experience with an accessibility bug involving a list component. Mitigating nested interactive structures involves limiting these patterns during development and restructuring existing elements. The speaker provides recommendations for improving accessibility, such as adjusting role properties and gathering user feedback. The conclusion emphasizes the importance of accessible solutions and encourages sharing resources to build more inclusive experiences.
Dialog Dilemmas and Modal Mischief: A Deep Dive Into Pop-Ups
JSNation 2023JSNation 2023
10 min
Dialog Dilemmas and Modal Mischief: A Deep Dive Into Pop-Ups
The Talk discusses the use of dialogues and popovers in web development. Dialogues can be modal or non-modal and are now accessibility-supported. Popovers are versatile and can be added to any element without JavaScript. They provide suggestions, pickers, teaching UI, list boxes, and action menus. Modal and non-modal dialogues and popovers have different behaviors and dismissal methods. Browser support for these features is expanding, but there are still open questions about positioning, semantics, and other use cases.
Building a Fast Website for Every Single Visitor
React Advanced 2024React Advanced 2024
31 min
Building a Fast Website for Every Single Visitor
This talk focuses on building a fast and accessible website for all users, highlighting the importance of performance and user experience optimization. It emphasizes the need for adaptive implementation to cater to different devices and user conditions. The talk also discusses the factors beyond the developer's control, such as screen size, browsers, devices, internet connection, and sitting position. It highlights the significance of optimizing image components for various devices and the role of browser support and rendering engines. The speaker discusses the use of future APIs and the challenges of browser compatibility, as well as optimizing image formats and bundler compatibility. The talk provides insights on controlling bundler and device compatibility, optimizing CPU usage, internet connection, and JavaScript form submission. It concludes with a proposal to respond with save data instead of effective type for limited internet connections and recommends using React with adaptive hooks for better user experiences. Overall, the talk covers essential aspects of building a fast and accessible website.
a11y and TDD: A Perfect Match
JSNation 2022JSNation 2022
24 min
a11y and TDD: A Perfect Match
This Talk explores the intersection of accessibility and test-driven development (TDD) in software development. TDD is a process that involves writing tests before writing production code, providing a safety net for code changes. The Talk demonstrates how to apply TDD principles to real-life examples, such as filling out a form, and emphasizes the importance of user-centric testing. By using atomic design principles, code can be organized in a clean and easy way. The Talk also discusses the use of labels and test IDs in tests for improved accessibility.

Workshops on related topic

Web Accessibility for Ninjas: A Practical Approach for Creating Accessible Web Applications
React Summit 2023React Summit 2023
109 min
Web Accessibility for Ninjas: A Practical Approach for Creating Accessible Web Applications
Workshop
Asaf Shochet Avida
Eitan Noy
2 authors
In this hands-on workshop, we’ll equip you with the tools and techniques you need to create accessible web applications. We’ll explore the principles of inclusive design and learn how to test our websites using assistive technology to ensure that they work for everyone.
We’ll cover topics such as semantic markup, ARIA roles, accessible forms, and navigation, and then dive into coding exercises where you’ll get to apply what you’ve learned. We’ll use automated testing tools to validate our work and ensure that we meet accessibility standards.
By the end of this workshop, you’ll be equipped with the knowledge and skills to create accessible websites that work for everyone, and you’ll have hands-on experience using the latest techniques and tools for inclusive design and testing. Join us for this awesome coding workshop and become a ninja in web accessibility and inclusive design!
Automated accessibility testing with jest-axe and Lighthouse CI
TestJS Summit 2021TestJS Summit 2021
85 min
Automated accessibility testing with jest-axe and Lighthouse CI
Workshop
Bonnie Schulkin
Bonnie Schulkin
Do your automated tests include a11y checks? This workshop will cover how to get started with jest-axe to detect code-based accessibility violations, and Lighthouse CI to validate the accessibility of fully rendered pages. No amount of automated tests can replace manual accessibility testing, but these checks will make sure that your manual testers aren't doing more work than they need to.
Web Accessibility in JavaScript Apps
React Summit 2022React Summit 2022
161 min
Web Accessibility in JavaScript Apps
Workshop
Sandrina Pereira
Sandrina Pereira
Often we see JavaScript damaging the accessibility of a website. In this workshop, you’ll learn how to avoid common mistakes and how to use JS in your favor to actually enhance the accessibility of your web apps!
In this workshop we’ll explore multiple real-world examples with accessibility no-nos, and you'll learn how to make them work for people using a mouse or a keyboard. You’ll also learn how screen readers are used, and I'll show you that there's no reason to be afraid of using one!
Join me and let me show you how accessibility doesn't limit your solutions or skills. On the contrary, it will make them more inclusive!
By the end, you will:- Understand WCAG principles and how they're organized- Know common cases where JavaScript is essential to accessibility- Create inclusive links, buttons and toggleble elements- Use live regions for errors and loading states- Integrate accessibility into your team workflow right away- Realize that creating accessible websites isn’t as hard as it sounds ;)