1

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> 
kian
  • 1,449
  • 2
  • 13
  • 21

1 Answers1

0

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

html

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

css

.yourClass {
    width: 85%;
}
Castle
  • 417
  • 3
  • 17
  • while the p tag helps, it still cuts the description if the text is too long. I'd need the panel to not shrink more than the total height of the description, like if the description would be a box – Lorenzo Bertolaccini Oct 20 '21 at 10:32