Skip to content

USWDS - Bug: Remove focus on text in validation component #5760

@amycole501

Description

@amycole501

Describe the bug

When auditing the validation component for keyboard accessibility I noticed that the text inside the "legend" area above the input field was focusable. Each validation check received a visible focus and JAWS instructed me to "use the arrow keys" to toggle between the items in the list.

Steps to reproduce the bug

  1. Go to https://designsystem.digital.gov/components/validation/
  2. Use a keyboard to tab into the component example
  3. Note that each sentence/validation check receives focus
    image
  4. If you listen using a screen reader you may be prompted to toggle between the two using the arrow keys on your keyboard

Expected Behavior

No visible focus should occur in the two checks/prompts. They look like text and it's an uncommon pattern to have focus appear around text without a clear indication of what the focus is supposed to do. Interacting with text seems like a bug.

Related code

The checklist code seems to be causing this behavior

  • Use at least one uppercase character
  • Use at least one number
  • Recommend changing it from a list of two items to something that doesn't cause focus to be drawn to the text.

    Screenshots

    No response

    System setup

    PC
    Desktop/laptop
    Chrome and Edge

    Additional context

    No response

    Code of Conduct

    Metadata

    Metadata

    Assignees

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions