patternfly / patternfly/react-data-view
DataViewFilters dropdown: Reset active attribute to first item after the filters are cleared
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 4
- フォーク
- 21
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
DataViewFilters の実装から始め、既存の「Clear all filters」の動作をたどり、アクティブな属性がどのように選択されるかも確認します。クリア時に常に最初の属性を選択するべきか、defaultActiveFilterId prop をサポートするべきかを判断し、その後、フィルターをクリアしたときに dropdown が期待どおりにリセットされることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100