mat-expansion-panel - styles get messed up if panel is a child of another element
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
#### Bug, feature request, or proposal:
The styles of panels will get messed up in the panels are placed in another element (ex: `div`)
Please see pseudo-code example below:
```html
...
...
```
#### What is the expected behavior?
Panels should be styled correctly
#### What is the current behavior?

#### What is the use-case or motivation for changing an existing behavior?
I was trying to implement draggable panels and my implementation has panels inside divs.
#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material 7.0.0-beta.2
#### Is there anything else we should know?
To fix replace [lines 15-29 in expansion-panel.scss](https://github.com/angular/material2/blob/master/src/lib/expansion/expansion-panel.scss#L15-L29):
```scss
.mat-accordion & {
&:not(.mat-expanded), &:not(.mat-expansion-panel-spacing) {
border-radius: 0;
}
&:first-of-type {
border-top-right-radius: $border-radius;
border-top-left-radius: $border-radius;
}
&:last-of-type {
border-bottom-right-radius: $border-radius;
border-bottom-left-radius: $border-radius;
}
}
```
... with the following:
```scss
.mat-accordion & {
&:not(.mat-expanded), &:not(.mat-expansion-panel-spacing) {
border-radius: 0;
}
}
.mat-accordion > &:first-child,
.mat-accordion > &:first-child:not(.mat-expansion-panel) & {
border-top-right-radius: $border-radius;
border-top-left-radius: $border-radius;
}
.mat-accordion > &:last-child,
.mat-accordion > *:last-child:not(.mat-expansion-panel) & {
border-bottom-right-radius: $border-radius;
border-bottom-left-radius: $border-radius;
}
```
コントリビューションガイド
調査の方向性
src/lib/expansion/expansion-panel.scss の参照された 15-29 行目から始め、div ラッパーを使ったネストされた mat-expansion-panel マークアップを再現します。報告されたセレクターの置換を既存のスタイルと比較し、パネルが他の要素内にネストされた場合でも、最初と最後のパネルが正しいボーダー半径を維持することを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100