Skip to content
easeweb
Search topics

Chat buttons that Tab skips, and close buttons with no name

The chat launcher is a div with a click handler, so Tab skips it, and the panel's × is a button holding only an icon, so a screen reader hears just "button".

WCAG 2.2
SC 2.1.1ASC 4.1.2A
Required by
Section 508 · EN 301 549 (EU)
Broken <div class="chat-launcher">
The accessibility problem illustrated: Motor:How do I open the chat?
01

The problem

Keyboard users can't open the support chat, and screen reader users aren't told which button closes it.

02

Try it

Open the chat and close it again with the keyboard alone, and hear what each button is called.

Tab down the page: does focus ever reach the chat bubble? Click the bubble to open the chat, then Tab to the × and read what a screen reader says under the page.

Apply a fix and do it all with the keyboard.

Broken Can you fix this?

BrokenA div launcher and an unnamed ×

Delivery

Most orders arrive within five working days. Large items are delivered on a day you choose.

Screen reader says:

(Tab through the page)

A recreated demo. The broken version is intentionally inaccessible.

03

The fix

Make the launcher and the × native buttons, and give each a name in words.

  1. 1The chat launcher is a native button that Tab reaches.
  2. 2The launcher and the close button each have a name in words, and their icons are hidden.
  3. 3Closing the chat puts focus back on the launcher.
Before A div launcher and an unnamed ×
<div class="chat-launcher">  <svg class="icon" viewBox="0 0 24 24">    <use href="#icon-chat"></use>  </svg></div><section id="chat" class="chat-panel" aria-labelledby="chat-title" hidden>  <div class="chat-header">    <h2 id="chat-title">Chat with Birchwood</h2>    <button type="button" class="chat-close">      <svg class="icon" viewBox="0 0 24 24">        <use href="#icon-close"></use>      </svg>    </button>  </div>  <div class="chat-messages" role="log" aria-label="Messages">    <p class="message from-us">Hi! How can we help with your order?</p>  </div>  <form class="chat-form">    <label for="chat-input" class="visually-hidden">Message</label>    <input id="chat-input" autocomplete="off">    <button>Send</button>  </form></section>
After

Named buttons, the round icon kept

<button type="button" class="chat-launcher" aria-label="Chat with us">  <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">    <use href="#icon-chat"></use>  </svg></button><section id="chat" class="chat-panel" aria-labelledby="chat-title" hidden>  <div class="chat-header">    <h2 id="chat-title">Chat with Birchwood</h2>    <button type="button" class="chat-close" aria-label="Close chat">      <svg class="icon" viewBox="0 0 24 24" aria-hidden="true">        <use href="#icon-close"></use>      </svg>    </button>  </div>  <div class="chat-messages" role="log" aria-label="Messages">    <p class="message from-us">Hi! How can we help with your order?</p>  </div>  <form class="chat-form">    <label for="chat-input" class="visually-hidden">Message</label>    <input id="chat-input" autocomplete="off">    <button>Send</button>  </form></section>

Why this fix: Use native HTML first

Easily confused
04

Verify the fix

5 checks, no mouse.

Test with: Keyboard, Screen reader, Speech input

0 of 5 checked

Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the chat widget, its vendor's script or its settings change.

Limits

This is a starting pattern for a launcher and a panel drawn by the page, not a guarantee for every widget. Whether a vendor's widget can be changed at all depends on the vendor; inside a frame from another domain, only its settings and the vendor can change it. Announcing the chat's messages is a separate failure, covered in chat widgets that never announce their messages, and a chat that is only a bot, with no way through to a person, in help chatbots with no way to reach a person. Test the complete journey with the assistive technology your visitors use.

This is a recreated teaching example, not a finding about a named client. The code is a starting pattern: test it in your own product. No completed assistive-technology test is claimed here.

EaseWeb service

Fixed it? Keep it from coming back.

I turn guides like this one into rules your coding agents follow and checks your CI runs. Then I retest by hand with a keyboard and screen readers, periodically.

See the service