patternfly / patternfly/react-data-view
DataViewFilters dropdown: Reset active attribute to first item after the filters are cleared
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 21
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi team, we’re using DataView + DataViewToolbar + DataViewFilters. When a user clicks “Clear all filters”, we want the attribute dropdown (in DataViewFilters) to reset to the first filter (our Name/URL) instead of staying on the last interacted attribute.
Right now, we’re nudging React to remount the first child by bumping a key on our Name/URL filter after clear. This works but is fragile/hacky.
Current Behavior
https://github.com/user-attachments/assets/262ec720-7d8e-4012-9908-5b8cc5a7ac10
Expected Behavior
https://github.com/user-attachments/assets/875101bd-bd92-4011-bf60-5f328238d0f8
Our Proposal
We have a couple of ideas on how to make this work more smoothly for everyone. We'd love to hear your thoughts on either of these solutions:
-
Make it the default. We think it would be great if
DataViewFilterssimply reset to the first attribute whenever filters are cleared. It’s what most users would expect, and it would save a lot of people from having to implement their own workarounds. -
Introduce a new prop. What if we added an optional prop like
defaultActiveFilterId? This would give developers the flexibility to explicitly set the default attribute, both on the initial load and after filters are cleared.
Thanks so much for considering our suggestions!
Jira Issue: PF-2719
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dall’implementazione di DataViewFilters e analizza il comportamento esistente di “Clear all filters”, incluso il modo in cui viene selezionato l’attributo attivo. Decidi se la cancellazione debba selezionare sempre il primo attributo o supportare una prop defaultActiveFilterId, quindi verifica che il dropdown venga reimpostato come previsto dopo la cancellazione dei filtri.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- react, typescript
- Ambito
- 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