angular / angular/components

mat-expansion-panel - styles get messed up if panel is a child of another element

オープン
#13,419 コメント 0 件 リアクション 16 件 担当者 0 名 GitHub で見る
area: material/expansion P4
主要言語
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?
![capture](https://user-images.githubusercontent.com/2098175/46462875-67203600-c777-11e8-9fc4-a1c11cc0f397.PNG)

#### 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

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

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