Search topics
Tag chips whose × the keyboard never reaches
A Skills tag input draws each chip's × as an svg with a click handler, so Tab never stops on it and only the last chip can be removed, with Backspace.
<svg class="chip-remove" viewBox="0 0 16 16"> The problem
Keyboard users can't remove a chip from the middle of a tag input, so a skill added by mistake stays on the profile
A job board's profile form has a Skills field drawn as a tag input. One rounded box holds the skills added so far, Design, Research and Writing, as chips, each with a small × to remove it, and a text field after them reads "Add a skill". Typing a skill and pressing Enter adds a chip. With a mouse, clicking any × takes its chip away.
With a keyboard, Tab goes past all three chips straight into the text field, and no key ever stops on an ×. Pressing Backspace in the empty field removes the last chip, Writing, as many tag inputs do. That is the only way the keyboard can take a chip off. Someone who added Research by mistake can't remove it without first removing Writing and typing it again, and with a longer row, every chip after the one they meant.
Success Criterion 2.1.1 asks that everything a mouse can do can be done with a keyboard. Removing any chip is something the mouse does, with one click on its ×. Each × is an svg with a click handler. An svg is not a control: it can't take focus, so Tab never stops on it and no key presses it. The browser lets any element take a click listener, and nothing warns when that element can't be reached any other way.
Backspace doesn't close the gap. It removes the last chip only, so it can't do what the mouse does on the second chip. Removing every chip after it and adding them again is a workaround a person has to work out, not a way to remove that chip.
Tag inputs hold what a profile, a filter or a post is about: skills, interests, labels, recipients. A chip that can't be taken off goes out with the form, or the person gives up on the field.
2 of 10 groups affected
- No vision (affected)
- Low vision (not affected)
- Colour vision (not affected)
- No hearing (not affected)
- Hard of hearing (not affected)
- No speech (not affected)
- Motor (affected)
- Reach, strength (not affected)
- Cognitive (not affected)
- Seizures (not affected)
- Limited manipulation Keyboard and switch users never reach an ×. Backspace takes chips off from the end only, so a skill in the middle can't be removed without removing every chip after it and typing them again.
- Without vision Screen reader users hear the chips as plain words, with no remove control among them, so nothing tells them a chip can be taken off, or how.
To a generic scan, the field looks sound. The text field has a label, and an svg with no role is a picture that needs no name, so nothing a rule knows of is wrong. A scan doesn't see that the picture takes clicks. EaseWeb's audit reports a cross inside a chip that Tab never reaches when it has a pointer cursor and a class that names it a remove control, such as chip-remove (ew:chip-remove-unreachable). It doesn't report a real button taken out of the Tab order with tabindex="-1", which fails in the same way. AI coding assistants asked for "a tag input with removable chips" can write the × as an svg or span with an onClick, or add role="button" to it without tabindex or keys, and add Backspace as the keyboard's way to remove. Only putting the mouse aside and trying to remove a chip in the middle shows whether it works.
Try it
Without the mouse, remove Research from Skills
Tab into Skills: Tab never stops on an ×, and Backspace in the empty field removes only the last chip, Writing. Clicking an × works.
Apply the fix: Tab now stops on each × before the field, and removing one moves focus to the next.
Broken Can you fix this?
Screen reader says:
(Tab to Skills)
The fix
Make each chip's × a named button that Tab reaches
<label for="skill-input">Skills</label><div class="tags"> <span class="chips"> <span class="chip"> Design <svg class="chip-remove" data-index="0" viewBox="0 0 16 16">…</svg> </span> <span class="chip"> Research <svg class="chip-remove" data-index="1" viewBox="0 0 16 16">…</svg> </span> <span class="chip"> Writing <svg class="chip-remove" data-index="2" viewBox="0 0 16 16">…</svg> </span> </span> <input id="skill-input" type="text" placeholder="Add a skill"></div>What is wrong3 points
The field has a label and adds chips from the keyboard. Removing them is where it fails.
- Each × is an
svgthat can't take focus, so Tab goes past it. - No key presses an ×, so no chip in the middle of the row can be removed.
- Backspace in the empty field removes only the last chip.
<label for="skill-input">Skills</label><div class="tags"> <span class="chips"> <span class="chip"> Design <button type="button" class="chip-remove" data-index="0" aria-label="Remove Design"> <svg viewBox="0 0 16 16" aria-hidden="true">…</svg> </button> </span> <span class="chip"> Research <button type="button" class="chip-remove" data-index="1" aria-label="Remove Research"> <svg viewBox="0 0 16 16" aria-hidden="true">…</svg> </button> </span> <span class="chip"> Writing <button type="button" class="chip-remove" data-index="2" aria-label="Remove Writing"> <svg viewBox="0 0 16 16" aria-hidden="true">…</svg> </button> </span> </span> <input id="skill-input" type="text" placeholder="Add a skill"></div>How it is fixed5 steps
- Make each × a
buttonholding the svg, and hide the svg witharia-hidden="true". Tab now stops on it, and Enter or Space presses it. - Name it with
aria-labelafter its chip, "Remove Research": the button holds only a picture, so without a label it would have no name, and "Remove" alone doesn't say which chip goes. - Give it a 24 by 24 pixel box and a focus ring of its own, so the small × is easy to hit and easy to see when Tab reaches it.
- When a chip goes, its button goes with it, so move focus to the next chip's button, the one before when there is no next, or the field when no chip is left. Without that, the focused button is gone and focus falls back to the page itself.
- Keep Backspace in the empty field as a shortcut for the last chip.
The chips keep their look. This fixes the Before and passes 2.1.1.
Why this fix: Use native HTML first
Many component libraries leave the × out of the Tab order, so the whole field is one Tab stop. Ant Design's Select draws it as a span hidden from assistive technology, Select2 4.1 renders a real button with tabindex="-1", and Tom Select and Tagify render it with tabindex="-1" as well (Tagify unless its a11y.focusableTags option is on). They fail in the same way as the svg. Check what your component renders, not its documentation, and look for an option that puts the × back in the Tab order.
Some components, such as MUI's Autocomplete, keep one Tab stop and move focus onto the chips with the Left arrow from the empty field, then remove the focused one with Backspace or Delete. That lets a keyboard reach every chip, but nothing on screen says the keys are there, and people who don't guess them are left with Backspace. If your component works this way, keep it, and put the buttons in the Tab order too.
Moving focus after a removal doesn't say that Research was removed; a screen reader reads the next button. If people need to hear it, that is a confirmation, covered in add to cart buttons that change a badge and say nothing. When the field suggests skills as people type, the suggestions follow autocomplete fields with silent, mouse-only suggestions. When the chips stand for the chosen options of a dropdown, which options are chosen has to be in the code as well, covered in multi-selects whose ticks are never read out.
A row of chips cut short with a "+3" count needs that count to be a button that shows the hidden chips, or the hidden ones can't be reached at all. Draw each × as a stroke in currentColor, not a background image, so it stays in a Windows contrast theme, and keep it visible at rest, not only on hover.
Design ideas
A chip can look like anything, as long as Tab reaches its ×
Three more ways sites draw a row of chips. Click them, then put the mouse aside and try them with Tab, Enter and Space: two pass, and one has an × that Tab never reaches.
In the design file
- Name each chip’s × as a button in the design file, so it is built on the real element.
- Write each × button’s name beside it, with its chip’s word, such as “Remove Design”.
- Draw every × with its focus ring, as it looks when reached with Tab, in a box of at least 24 by 24 pixels.
- Mark where focus goes after a chip is removed, the next chip or, when none is left, the field.
- Keep each × visible at rest, not only on hover, since keyboard users never hover, and touch users see it only after a tap, if at all.
Passes
- DesignWritingChips cut short by a “+2 more” button Two chips show, then a “+2 more” button that opens the rest and says it is open. Every chip, shown or opened, has its own × button, so none is out of reach.
- DesignWritingResearchCodingA chip row that ends in Clear all Each chip keeps its own × button, and a Clear all button in #115e59 (7.58:1) ends the row, so everything can go in one press. When it is pressed, focus moves to the field, since every button around it is gone.
Fails
- Design Writing Research CodingClean chips whose × shows on hoverWCAG 2.1.1 At rest the chips are plain words; pointing at one shows its ×. The × is not a button, so Tab never reaches it, and on a touch screen it shows only after a tap, if at all. Try it with Tab.
Verify the fix
5 checks, no mouse.
Test with: Keyboard, Screen reader, Forced colors
Record the OS, browser and assistive-technology versions, the build, the date, and the actual result of each step. Repeat after the shared chip or tag component changes.
Limits
This is a starting pattern for a short row of chips typed in by the person. It doesn't cover chips that can be edited in place, reordered by dragging, or loaded from a server. Test the complete journey, with your real data, in the browsers and assistive technology you support.
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.