mat-panel-description doesn't fit when panel shrinks

Viewed 187

I have a mat-panel in my HTML, which description takes a variable from the TS to get filled with. Problem is, then I shrink the panel and the description is too long, the text gets cut on top and bottom. How can I make that, when the panel is shrinked, it is forced to not shrink more than the total height of the description?

HTML:

<mat-expansion-panel-header>
      <mat-panel-title>
        Filtri
      </mat-panel-title>
      <mat-panel-description>
        {{filteredDescription}}
      </mat-panel-description>
    </mat-expansion-panel-header> 
1 Answers

You should wrap {{filteredDescription}} in p tag.

html

<p class="yourClass">
 {{filteredDescription}}
</p>

css

.yourClass {
    width: 85%;
}
Related