angular / angular/components

Support intersection/clipping detection in overlay positioning

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

#### What are you trying to do?

I am trying to set a position strategy that works when origin element is clipped. Is there any way to do this without writing a custom position strategy?

#### What troubleshooting steps have you tried?

I tried all the strategies available through CDK Api but without success.

#### Reproduction

https://stackblitz.com/edit/angular-rplbez

Basically, i have to 2 connected positions defined. First that will center the overlay below origin element and another one that will center the overlay above origin element. For example, if element is on the top of the page, overlay would go out of viewport and then second position will be used (below origin element). That works fine. But if origin element is clipped (as in stackblitz example) then overlay will be positioned using first position (above origin element).

Steps to reproduce:
1. Click on a blue square
2. Opened popover is over red header

#### Environment

- Angular: 10.0.9
- CDK/Material: 10.1.3
- Browser(s): Chrome 84.0
- Operating System (e.g. Windows, macOS, Ubuntu): MacOS 10.15.3

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

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

Hướng nghiên cứu

Bắt đầu với bản tái hiện StackBlitz được liên kết và kiểm tra hành vi định vị của CDK overlay đối với hai vị trí được kết nối. Tái hiện trường hợp origin bị cắt, sau đó xác minh rằng việc phát hiện giao nhau hoặc cắt chọn vị trí thay thế, đồng thời vẫn giữ nguyên hành vi fallback hiện có của viewport.

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
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
Khá rõ ràng
Mức phù hợp với người mới
35/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.