angular / angular/components

bug(Listbox): Can not select first option with Enter after calling .goToFirst() (@angular/aria)

Ouverte
#32,762 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area: aria/listbox P3
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

When calling `.goToFirst()` the first option is set active. But it is not possible to select it with _Enter_. If the user hits _arrow down_ one time you can select the first option. But my whole reason for calling `.goToFirst()` is so the user do not need arrows when first option is the one they want.

I suspect an underlying keyboard manager is not being synced when calling `.goToFirst()'

### Reproduction

StackBlitz link: https://stackblitz.com/edit/go-to-first-issue-angular-aria-wpcbw3sz?file=src%2FApp.ts
Steps to reproduce:
1. Load stackblitz
2. Hit enter
Hitting enter should trigger en alert with the text "Option 0", but it does not happen

### Expected Behavior

When calling `.goToFirst()` the first option is selected and hitting Enter on the keyboard will select it.

### Actual Behavior

Nothing happens when hitting Enter

### Environment

- Angular: 21.1.3
- CDK/Material: 21.1.3
- Browser(s): Edge, Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows, Macos

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée, en particulier src/App.ts, et reproduisez la séquence .goToFirst() puis Enter. Examinez la synchronisation suspectée de keyboard-manager et vérifiez qu’appuyer sur Enter après être passé à la première option déclenche une alert contenant "Option 0" sans nécessiter Arrow Down.

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

Évaluation

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

Recevez les nouvelles issues par e-mail

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