angular / angular/components

bug(Chips): Selecting value from autocomplete by keyboard navigation causes both the search string and the selected option to be added

Ouverte
#28,852 2 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
area: material/chips P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

Reproducible on this [example](https://material.angular.io/components/chips/overview#chips-autocomplete).

### Reproduction

StackBlitz link: https://stackblitz.com/edit/rd9usi?file=package.json
Steps to reproduce:
1. Type any input that is a substring of any item in the suggestion list
2. Navigate to a suggestion with keyboard
3. Press Enter
4. Both the search string and the selected are added

### Expected Behavior

Only the selected suggestion is added

### Actual Behavior

Both the selected and the suggested values are added

### Environment

- Angular: 16.2.6
- CDK/Material: 16.2.8
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): darwin arm64

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée, y compris package.json, et comparez son comportement avec l’exemple d’autocomplétion Chips. Suivez la navigation au clavier et le traitement de Enter pour une sous-chaîne saisie, puis vérifiez que seule la suggestion sélectionnée est ajoutée et que la chaîne de recherche n’est pas ajoutée également.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
42/100

Recevez les nouvelles issues par e-mail

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