angular / angular/components

feat(Listbox): Allow Listbox to be found in content projection

Aperta
#26,556 3 commenti 7 reazioni 0 assegnatari Vedi su GitHub
area: cdk/listbox feature P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Feature Description

The Listbox cdk directive could be used as a select component's options. This would be nice because it has built in accessibilty features and keyboard interactions. The problem is if those select component options are content projected they cannot find their parent listbox directive.

### Use Case

So if I wanted my custom select component implementation to look like this:

![image](https://user-images.githubusercontent.com/26122765/216383475-edeaf89e-5798-49e3-b8fa-8b269a46cc19.png)

The custom select options are being content projected and the custom select logic would look something like this:

![image](https://user-images.githubusercontent.com/26122765/216383926-10a91b6e-005c-4e4d-8f55-edc2ac19f073.png)

The select option that is not content projected is working as expected but the content projected ones are not finding their parent listbox and therefore not behaving correctly.

Stackblitz for reference : https://stackblitz.com/edit/angular-ivy-tcfqrs?embed=1&file=src/app/select/select.component.ts

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla riproduzione StackBlitz collegata e analizza come viene risolta la Listbox CDK directive per le opzioni proiettate rispetto a quelle non proiettate. Conferma il comportamento per l’esempio di selezione personalizzata, quindi verifica che le content-projected options trovino il loro Listbox padre e mantengano le interazioni previste per l’accessibilità e la tastiera.

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

Valutazione

Stack tecnologico
angular, typescript
Ambito
accessibility, frontend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.