angular / angular/components

Setting maxHeight on overlay with flexibleConnectedTo strategy does not work, when viewport margin is also configured

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

#### Reproduction

Steps to reproduce:
1. Visit the [stackblitz](https://stackblitz.com/edit/understanding-overlay-03-viewport-margin-bug)
2. Click the 2 buttons


#### Expected Behavior

That the max height of 300px is respected in both cases

#### Actual Behavior

Max height is only respected, if `withViewportMargin(10)` is not configured.

#### Environment

- Angular: 8.2.13
- CDK/Material: 8.2.3
- Browser(s): `Version 78.0.3904.70 (Official Build) (64-bit)`
- Operating System (e.g. Windows, macOS, Ubuntu): `macOS Mojave`

#### Gif

![bug-2](https://user-images.githubusercontent.com/9967422/68024963-e1d5c080-fcab-11e9-8f39-c4a25de26309.gif)

#### Relevant code

```typescript
const overlayRef = this.overlay.create({
hasBackdrop: true,
positionStrategy: this.overlay.position().flexibleConnectedTo(element)

// The max height is only respected, if the viewport margin is left out
.withViewportMargin(10) // <------

.withPositions([
{
originX: 'end',
originY: 'bottom',
overlayX: 'end',
overlayY: 'top',
},
]),
width: '200px',
maxHeight: '300px',
});
```

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à ví dụ overlay.create sử dụng flexibleConnectedTo, withViewportMargin(10) và maxHeight. Theo dõi cách cơ chế định vị kết nối linh hoạt xử lý lề viewport và xác minh bản sửa lỗi với cả hai nút, đảm bảo chiều cao tối đa 300px được tôn trọng trong từng trường hợp.

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
42/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.