ionic-team / ionic-team/ionic-framework

feat: improved `aria-label` for the searchbar's clear button, or a way for consuming apps to customize this value

Ouverte
#29,116 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
package: core type: bug
Langage dominant
TypeScript
Étoiles
52.7k
Forks
13.3k
Merge moyen
1 j 15 h
PR mergées (30 j)
51

Description

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already include this feature request, without success.

### Describe the Feature Request

The clear button on the `ion-searchbar` has an `aria-label` of "reset" ([code here](https://github.com/ionic-team/ionic-framework/blob/5a5f330705f77a8971119fad448101a5504d8e5e/core/src/components/searchbar/searchbar.tsx#L636)), which is not clear enough for screenreader users. The label should be more descriptive, perhaps “clear search input”.

### Describe the Use Case

"Reset" may be unclear to screenreader users, and so the button's `aria-label` should be more descriptive.

### Describe Preferred Solution

Two possible solutions:

1. Add a prop so that consuming applications can optionally pass their own `aria-label` for the searchbar's "clear button".
2. Update the existing `aria-label` ([here](https://github.com/ionic-team/ionic-framework/blob/5a5f330705f77a8971119fad448101a5504d8e5e/core/src/components/searchbar/searchbar.tsx#L636)) to be something more descriptive, like "clear search input".

Thank you!!

### Describe Alternatives

_No response_

### Related Code

_No response_

### Additional Information

_No response_

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.