Skip to content

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

Open

Description

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

Metadata

Type

No type

Projects

  • Status

    Needs refinement

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions