Skip to content

TagGroup accessibility issue: removing tags with keyboard alone #7483

Open
@CarynPagelTR

Description

@CarynPagelTR

Provide a general summary of the issue here

To remove a tag with keyboard alone, the user has to press Backspace/Delete while the tag is focused. This is not an expected interaction for keyboard users. A keyboard user will expect the x/delete button to receive focus and to press Enter or Spacebar to activate it, as they would for any other element.

🤔 Expected Behavior?

  • Tag does not receive keyboard focus, because it is not an interactive element.
  • x/delete button is an HTML button element, therefore:
    -- receives keyboard focus
    -- can be activated via Enter or Spacebar keys.

😯 Current Behavior

  • Tag receives keyboard focus.
  • x/delete button does not receive keyboard focus.
  • To delete a tag with keyboard, user has to bring focus to the tag, and press Backspace/Delete.

💁 Possible Solution

  • Remove tabindex attribute from
    and
  • Remove aria-labelledby attribute from
  • Update aria-label value on
  • to be clear.

    Current HTML:

    Shopping

    Suggested HTML:

    Shopping ⓧ

    🔦 Context

    This component is unusable for a keyboard user unless they are able to guess the keyboard interaction.

    🖥️ Steps to Reproduce

    1. Visit https://react-spectrum.adobe.com/react-aria/TagGroup.html#removing-tags using any browser.
    2. Use keyboard alone (no screen reader, no mouse, no touch screen) to attempt to remove a tag.
    3. Notice the delete button does receive focus and cannot be activated with Enter/Return or Spacebar.

    Version

    1.5

    What browsers are you seeing the problem on?

    Firefox, Chrome, Safari, Microsoft Edge

    If other, please specify.

    No response

    What operating system are you using?

    Mac. Same issue happens on Windows.

    🧢 Your Company/Team

    Thomson Reuters / The Insurer

    🕷 Tracking Issue

    No response

    Metadata

    Metadata

    Assignees

    No one assigned

      Type

      No type

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions