ionic-team / ionic-team/ionic-framework
feat: accordion, improve customizability of toggle icons based on state and add label text
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 51
Mô tả
# Feature Request
**Ionic version:**
[ ] **4.x**
[ ] **5.x**
[X] **6.x**
**Describe the Feature Request**
Currently in our App we create a own Accordion Component, which i want to replace by the Ionic one in the Future. But we have two Icons, one for expanded and one for collapsed state, which does not rotate.
I wan't to be able to create it like this too. I can create a PR, but we should discuss the best was to implement this.
**Describe Solutions**
I understand that we can create a own Icon with Class `ion-accordion-toggle-icon` and then no extra Icon will be created. But because of this Class the icon will rotate between the states. So one Option would be to add a `toggleIconRotate: boolean` Prop. I don't like this option as the user has to check by himself if the accordion is collapsed or not and set the specific icon on his own.
**The better option** was if the accordion component would be able to do this itself. So maybe by setting the Type of `toggleIcon` to `string | {collapsed: string; expanded: string;}` and use two different icons based on the state. If this option is used the icon would not rotate.
**Additional Context**
What do you think? Do you prefer a Option? Should i create a PR?
Hướng dẫn đóng góp
Hướng nghiên cứu
Start at the Ionic accordion component and review the existing ion-accordion-toggle-icon behavior, including how expanded and collapsed states are represented. Clarify whether the desired result is state-specific icons, optional rotation, label text, or all three; done should include the agreed API and coverage for each supported state.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- frontend
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100