DataViewFilters dropdown: Reset active attribute to first item after the filters are cleared
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ phần triển khai DataViewFilters và lần theo hành vi “Clear all filters” hiện có, bao gồm cả cách thuộc tính đang hoạt động được chọn. Xác định xem việc xóa có luôn phải chọn thuộc tính đầu tiên hay hỗ trợ một prop defaultActiveFilterId, sau đó kiểm tra rằng dropdown được đặt lại như mong đợi sau khi các bộ lọc được xóa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 21
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của patternfly/react-data-view
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
patternfly/react-data-view#692 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
patternfly/react-data-view#680 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
patternfly/react-data-view#671 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
patternfly/react-data-view#662 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
patternfly/react-data-view#676 · 2 bình luận ·
Tất cả issue của patternfly/react-data-view
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100