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