Visitar URL original
USWDS - Bug: Search input uses non-standard clear button that is not available in Firefox · Issue #5834 · uswds/uswds · GitHub
Skip to content

USWDS - Bug: Search input uses non-standard clear button that is not available in Firefox #5834

Closed as not planned

Description

@anselmbradford

Describe the bug

After entering text in the search inputs on https://designsystem.digital.gov/components/search/, a clear button is shown. I have a few questions around this:

  • This uses a non-standard browser default clear button that is not supported in Firefox, so Firefox visitors will get no clear button.

  • It also does not have a hover state.

  • It is not accessible via the keyboard. I'm not sure if this is an issue or not. Is the expectation with a screenreader that the escape key could be used to clear the input, and it is therefore not necessary that the clear button be accessible?

Steps to reproduce the bug

  1. Go to https://designsystem.digital.gov/components/search/ in Chrome.
  2. Enter some text in the search input and see there is a clear button that appears.
  3. Go to the same page in Firefox.
  4. Enter some text in the search input and see there is no clear button.

Expected Behavior

Clear button is consistent across major browsers.

Related code

No response

Screenshots

Chrome
Screenshot 2024-03-22 at 5 46 56 PM

Firefox
Screenshot 2024-03-22 at 5 46 52 PM

System setup

No response

Additional context

This branch shows how a cross-browser (x) clear button could be created via the use of a reset button accompanying the search input. However, this may not be an optimal solution https://github.com/cfpb/consumerfinance.gov/compare/ans_global_search_fix?expand=1

Code of Conduct

Activity

  1. added
    Needs: ConfirmationReported behavior needs validation. Remove after recording reproduction or investigation results.
    on Mar 22, 2024
  2. added
    Needs: DiscussionAn unresolved decision blocks progress. Name the decision; remove this label when decided.
    on Apr 4, 2024
  3. mejiaj commented on Apr 11, 2024

    @mejiaj
    Contributor

    Based on 04-09-24 Dev sync discussion...

    • A11Y team will test to determine priority & severity.
    • Outline on site guidance that this is a browser issue.

    Adding @amycole501 & @alex-hull to sync up with @amyleadem and continue work.

  4. removed
    Needs: DiscussionAn unresolved decision blocks progress. Name the decision; remove this label when decided.
    on Apr 11, 2024
  5. moved this to Ready to Schedule in USWDS Core Project Dataon Apr 11, 2024
  6. amycole501 commented on Apr 15, 2024

    @amycole501

    Using both JAWS and NVDA I don't hear the "clear" button announced. It's inoperable to both screen readers and keyboard users.

    Firefox is suppressing the feature and this has been brought to the attention to other design systems. Also this jquery-archive/jquery-mobile#6467

    User agents have to comply with WCAG 2.0. I suggest the issue go to Firefox.

    For now, I don't recommend we prioritize a solution due to the fact that this is a single browser issue and there is an alternate means by which the user can delete content out of the field.

    That said, I plan to audit the search component this sprint; I can further update this issue as my research develops.

  7. anselmbradford commented on Apr 25, 2024

    @anselmbradford
    ContributorAuthor

    @amycole501 I took the reset button technique referenced above and slimmed it down to a jsfiddle at https://jsfiddle.net/9buarncv/7/ (viewable full screen at https://jsfiddle.net/9buarncv/7/show). How does that look for accessibility? My testing shows it working the same in Firefox and Chrome, but Safari does not allow tabbing to the button, which would be equivalent to the status quo of the default (x) button that shows up in Chrome. So cross-browser improvement in Chrome and Firefox, status quo in Safari (although it does make the appearance of the (x) in Safari consistent with the others).

  8. amycole501 commented on Apr 29, 2024

    @amycole501

    Nice solution! It worked well in both NVDA and JAWS in Chrome and Firefox. I'm not sure how much retesting we'd need to do if we implemented this solution given the constantly changing nature of browsers. However I defer @mejiaj and team to determine if the solution fits our technical standards and practices and is something we'd want to include in the component.

    But from an accessibility standpoint it solves the issue of the button not being announced (it is now in both NVDA and JAWS) and it's also focusable with a keyboard.

  9. 22 remaining items

  10. removed
    Role: DevDev expertise is relevant. Project Active Role tracks ownership; this label is not an assignment.
    on Feb 7, 2025
  11. added
    Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.
    Status: TriageLegacy intake label used by templates. Project Status is authoritative; avoid manual duplication.
    on May 2, 2026
  12. mgifford commented on May 16, 2026

    @mgifford
    Contributor

    I can confirm that the x still doesn't work in Firefox here, although it does in Chrome:
    https://designsystem.digital.gov/components/search/

    I noticed a problem that the "x" to clear the image isn't keyboard accessible.

    However looking at other design sytems with this:
    https://design.sis.gov.uk/components/inputs/search-bar/accessibility/

    or even closer to home:
    https://design.va.gov/components/search-input

    The code proposed here also seems to work in Firefox and Chrome:
    https://jsfiddle.net/9buarncv/7/

    but It was too bad that the Search button wasn't also included in his example.

  13. removed their assignment
    on Aug 3, 2026
  14. chandracarney commented on Sep 10, 2026

    @chandracarney
    Contributor

    In June, we discussed that this needs further testing and triage. Here are our initial thoughts:

    • When the issue is with the browser itself, an accessibility principle is generally that we shouldn't be touching built-in browser issues; instead open issues with the browser teams to pressure them to fix issues. (Browsers or any upstream dependency: hardware and software alike.)
    • Need to read through all the links and background before a decision to close or proceed.
    • If we make changes:
      • Danger: If the browsers update, the cascade to USWDS could conflict with our work and cause problems for sites running USWDS. Need to be careful.
      • We'd need to do some hacking to make it work as described.
  15. added
    Needs: ResearchA specific evidence gap blocks a decision. Link the research question and remove when answered.
    and removed
    Type: Feature RequestCompatibility label; native Enhancement type is authoritative. Retained for templates/search links.
    Status: TriageLegacy intake label used by templates. Project Status is authoritative; avoid manual duplication.
    on Sep 17, 2026
  16. ryparker commented on Sep 18, 2026

    @ryparker
    Member

    I'm closing this as not planned and continuing the proposal for an optional clear button in discussion #6971.

    The CFPB implementation and the earlier JAWS/NVDA results are useful starting points. We still need to weigh the added markup and events, server-populated values, behavior without JavaScript, and the risk of conflicts with future browser changes. Standard keyboard text editing remains available; we haven't approved replacing the native control by default.

    The discussion includes the proposal and compatibility requirements. GitHub's issue conversion didn't complete, so it links back here to preserve the original report and comments. The usability concern remains open for discussion.

  17. removed
    Needs: ResearchA specific evidence gap blocks a decision. Link the research question and remove when answered.
    on Sep 18, 2026
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

    Affects: Accessibility 🟡Affects access for disabled users or assistive tech. Record the barrier; not a severity score.Package: SearchWork affecting Search. Apply only when this area helps route or find the issue.

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions