angular / angular/components

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

Aperta
#28,852 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
area: material/chips P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz collegata, incluso package.json, e confronta il suo comportamento con l'esempio di autocompletamento Chips. Traccia la navigazione da tastiera e la gestione di Enter per una sottostringa digitata, quindi verifica che venga aggiunto solo il suggerimento selezionato e che la stringa di ricerca non venga aggiunta a sua volta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.