DataViewFilters dropdown: Reset active attribute to first item after the filters are cleared
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start at the DataViewFilters implementation and trace the existing “Clear all filters” behavior, including how the active attribute is selected. Decide whether clearing should always select the first attribute or support a defaultActiveFilterId prop, then verify that the dropdown resets as expected after filters are cleared.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 4
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from patternfly/react-data-view
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
patternfly/react-data-view#692 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
patternfly/react-data-view#680 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
patternfly/react-data-view#671 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
patternfly/react-data-view#662 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
patternfly/react-data-view#676 · 2 comments ·
All issues in patternfly/react-data-view
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100