Skip to content

Consider adding a visible label for search component #3107

Open
@laflannery

Description

@laflannery

Bug Report

  • I’ve searched for any related issues and avoided creating a duplicate issue.

What happened

This component uses label prop that displays as a sr-only label and an aria-label on the input. This is odd because this is duplcative - we don't need both the label and the aria-label.

However, there are also use cases of search where a visible label would be better, Resources and support for example. There currently isn't a way for me to use the visual label "Enter a keyword, phrase, or question" as the programmatic label of the search input so now we have this on the page 3 times.

What I expected to happen

It would be better if a <label> could be used and visible and the aria-label could be removed when not needed.
Examples/use cases of when to use the aria-label and when to use a visible <label> should also be documented to ensure teams don't use these are the same time or incorrectly

Reproducing

  • Formation version:
  • Device: (e.g. iPhone 8, Macbook)
  • Browser: (e.g. Firefox, IE 11)

Steps to reproduce:

Urgency

How urgent is this request? Please select the appropriate option below and/or provide details

  • This bug is blocking work currently in progress
  • This bug is affecting work currently in progress but we have a workaround
  • This bug is blocking work planned within the next few sprints
  • This bug is not blocking any work
  • Other

Details

Activity

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

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