angular / angular/components

mat-expansion-panel keeps contents of collapsed panels in DOM

Đang mở
#20,680 12 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: material/expansion G P2
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

I found this while debugging rendering performance in my app. I have a large section that initially renders as a big mat-expansion-panel with all panels collapsed, except one. Here is a screenshot of mat-expansion-panel demo that sxhibits the same behavior:

![4kunmyWShAfRwzA](https://user-images.githubusercontent.com/3027415/94566715-f24f3c00-026a-11eb-9c09-139061cd4181.png)

I believe that the contents of the collapsed sections should be removed from the DOM to not slow down the application by rendering content that isn't currently visible.

If the reason for doing that was animations, then the animations probably need fixing - Angular supports keeping things in DOM while they are animating. Or maybe this was used, but the animation end never gets registered? I'm gussing :) In any case I believe it's a bug.

CC @jelbourn

Possilbly related (?): https://github.com/angular/components/issues/8287

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi trong bản demo mat-expansion-panel được hiển thị trong issue, với một số panel được thu gọn và một panel được mở rộng. Theo dõi phần triển khai mat-expansion-panel và hành vi animation của nó; hoàn thành nghĩa là nội dung của các panel đã thu gọn được xóa khỏi DOM mà không làm hỏng các transition.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.