angular / angular/components

bug(cdk/overlay): scroll blocking overlay persists when documentElement shrinks to the point it is not needed

Đang mở
#30,943 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: cdk/overlay P4
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ả

### Description

This came up for an app that had a button to launch a full screen dialog. When you click the button it essentially hides the main app and launches the dialog. However, at the time the dialog launches, the content is still showing so it calculates the height based on documentElement here (https://github.com/angular/components/blob/main/src/cdk/overlay/scroll/block-scroll-strategy.ts#L111) and determines the scroll blocking class is needed. The main content then disappears making the blocking class unnecessary, but it never updates after the initial calculation. This results in a disabled scrollbar being shown in the app.

As a workaround, apps in this situation should ensure that they remove content they want to hide & wait for that change to be rendered in the DOM before launching the dialog.

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

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

Hướng nghiên cứu

Bắt đầu trong src/cdk/overlay/scroll/block-scroll-strategy.ts, khoảng dòng 111, nơi kích thước của documentElement được dùng để quyết định có cần chặn thao tác cuộn hay không. Tái hiện chuỗi thao tác bằng cách mở một hộp thoại toàn màn hình khi nội dung chính vẫn còn hiện diện, sau đó ẩn nội dung đó. Được xem là hoàn tất khi trạng thái chặn không cần thiết không còn bị giữ lại và thanh cuộn bị vô hiệu hóa không được hiển thị.

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.