angular / angular/components

CDK overlay auto calculate width when using ConnectedPositionStrategy

オープン
#10,393 コメント 13 件 リアクション 22 件 担当者 0 名 GitHub で見る
area: cdk/overlay feature P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Bug, feature request, or proposal:
Feature

#### What is the expected behavior?
That i can somehow configure the popup overlay to change it width to be the same as the parent, without having to add a bunch of custom styling to my popup component.
![good](https://user-images.githubusercontent.com/1499810/37336174-de6f20a8-26b0-11e8-8924-a2df159cceaf.png)

#### What is the current behavior?
![bad](https://user-images.githubusercontent.com/1499810/37336151-cfbf6fb8-26b0-11e8-9fc4-88e4d6adff71.png)

#### What is the use-case or motivation for changing an existing behavior?
I would have to do less custom styling to get a nice dropdown

#### Is there anything else we should know?
In the screenshots we have changed the width using css, however this is suboptimal to having a responsive design, where the input can change their width all the time.
To get around the problem we have to hard-code the width of both the input and the popups, so they look to fit together.

My best suggestion would be able to do something like this:

```typescript
this.overlay.position()
.connectedTo(target, {
originY: 'bottom',
originX: 'start'
}, {
overlayY: 'top',
overlayX: 'start'
})
.immitateWidth();
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

CDK overlay ConnectedPositionStrategy API から始め、issue に記載されたレスポンシブ幅のケースを再現してください。完了の条件は、親の変更に合わせて接続されたポップアップが親の幅に合わせられ、ポップアップコンポーネントにカスタムスタイルを適用する必要がないことです。レポートでは、特定のソースファイルやテストは指定されていません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。