angular / angular/components

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

Ouverte
#13,419 0 commentaires 16 réactions 0 personnes assignées Voir sur GitHub
area: material/expansion P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### 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;
}
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez dans src/lib/expansion/expansion-panel.scss, aux lignes référencées 15-29, et reproduisez le balisage imbriqué de mat-expansion-panel avec des wrappers div. Comparez le remplacement de sélecteur signalé avec les styles existants, puis vérifiez que le premier et le dernier panneau conservent des rayons de bordure corrects lorsque les panneaux sont imbriqués dans d’autres éléments.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular
Domaine
frontend
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.