Visitar URL original
USWDS - Bug: Range slider focus improvements · Issue #6117 · uswds/uswds · GitHub
Skip to content

USWDS - Bug: Range slider focus improvements #6117

Closed
1 of 1 issue completed
Closed

Description

@amycole501

Describe the bug

We found two potential issues in the range slider audit:

  1. The current version of the range slider receives keyboard focus around the entire component. The only interactive element is the button which also receives focus. The dual focused elements doesn't seem intuitive as the slider bar isn't the interactive part.

  2. Also, the focus indicator on the button is quite small. We recommend increasing it at the very least to match closer to what W3C offers in their examples.

Steps to reproduce the bug

  1. Go to https://designsystem.digital.gov/components/range-slider/
  2. Keyboard tab into the range slider
  3. Note that the entire element receives focus.
  4. Note also how small and nearly imperceptible the focus indicator is on the button. It's a small blue outline and not offset or larger. The touch target may not meet the enhanced size.

Expected Behavior

See an example of other range sliders where focus is only on the button:
https://carbondesignsystem.com/components/slider/usage/#feedback
https://www.w3.org/WAI/ARIA/apg/patterns/slider/examples/slider-color-viewer/ <<the entire component receives focus but the button's focus is much clearer. The other slider examples from W3 only show the button receiving focus.

Related code

No response

Screenshots

No response

System setup

PC, Chrome

Additional context

No response

Code of Conduct

Activity

  1. added
    A11Y Audit FindingsA finding from an accessibility audit. Keep links to the test, result, and affected user experience.
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    Package: Range SliderWork affecting Range Slider. Apply only when this area helps route or find the issue.
    on Oct 15, 2024
  2. moved this to Ready to Schedule in USWDS Core Project Dataon Oct 31, 2024
  3. modified the milestones: USWDS release: December 2024, on Oct 31, 2024
  4. added
    Type: SpikeA bounded investigation to answer a specific question; use native Task for the issue type.
    on Oct 31, 2024
  5. amyleadem commented on Oct 31, 2024

    @amyleadem
    Contributor

    Note

    This might be something we can work into #6116

    Next steps

    • Evaluate the landscape of accessible range sliders
    • Document the requirements for the touch target and focus state design for this component
    • Test current touch target interaction with touch devices
    • Assess the weight/priority of this issue
  6. 15 remaining items

  7. amycole501 commented on Mar 14, 2025

    @amycole501
    Author

    Would like to get @juliaelman to review this and estimate an effort for getting this done before the May deliverables deadline.

  8. amycole501 commented on Mar 14, 2025

    @amycole501
    Author

    Feedback from Dave Stenger, 508 lead for the USA site:

    The range slider is built on native elements (typically an ) that include a focus indicator by default which ensures it’s both clearly visible and compliant with WCAG 2.2’s focus requirements (specifically WCAG 2.4.7 – Focus Visible).
    Key Points

    • Native Focus Handling:

    Because the component is based on a native range input, it benefits from built‑in focus management. USWDS adds custom styling to make the focus state stand out.

    • Custom Styling for Focus:

    USWDS generally applies a distinct outline or box-shadow when the range slider receives focus. This styling is designed to meet contrast and size guidelines so that keyboard users can easily see which element is active.

    My recommendations for developers

    1. Review Default Styles:
      Ensure that any custom CSS does not diminish the default focus indicator provided by USWDS. The focus indicator should be visible against the background with sufficient contrast.
    2. Test Across Browsers:
      Although USWDS is designed to be robust, always test the component in multiple browsers and assistive technologies to verify that the focus styling appears consistently.
    3. Avoid Removing Focus Outlines:
      Do not remove the focus outline for aesthetic reasons. If you need to modify it, ensure that the new styling meets WCAG 2.2’s contrast and visibility standards.

    My conclusion
    When used as provided, the USWDS range slider does pass the visible focus guidelines outlined in WCAG 2.2. As long as you maintain or enhance the default focus styles, it will remain accessible to keyboard users and compliant with the standards.

    AND

    I would recommend the actual slider have thicker lines. With the bigger blue outline focus gives a user with low vision the ability to see where they are but the thinner lines inside I think should be the same size or just a hair smaller. (my personal recommendation)

  9. added
    Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.
    Role: A11YA11Y expertise is relevant. Project Active Role tracks ownership; this label is not an assignment.
    on Jul 17, 2026
  10. ethangardner commented on Sep 11, 2026

    @ethangardner
    Contributor

    Closing this spike as resolved. Research confirmed that native <input type="range"> focus handling satisfies WCAG requirements, and the actionable track/thumb contrast and visible focus styling improvements were implemented under sub-issue #6444 and merged into develop via PR #6659. Documentation updates were also completed in uswds-site#3239.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A11Y Audit FindingsA finding from an accessibility audit. Keep links to the test, result, and affected user experience.A11Y Audit: Passes with exceptionsAn audit passed with documented exceptions. Preserve those exceptions and remaining work.Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.Package: Range SliderWork affecting Range Slider. Apply only when this area helps route or find the issue.Role: A11YA11Y expertise is relevant. Project Active Role tracks ownership; this label is not an assignment.Type: SpikeA bounded investigation to answer a specific question; use native Task for the issue type.

    Type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions