[![在此处输入图像描述][1]][1]我想为文本区域设置最大高度,因此当用户继续添加文本时,如果达到最大高度,它将添加一个滚动。但是我目前的实现是它拉伸了 modal ,所以如果我添加更多文本,modal 就会变得太长。
我们如何使模态不会被拉伸?谢谢。
html
<div fxLayout="row" fxLayoutAlign="start start" class="full-width question-text" fxLayoutGap="12px">
<mat-form-field style="height: auto; overflow: hidden;" class="pr-4" appearance="outline">
<mat-label>Comments</mat-label>
<div
style="
margin-right: 10px;
overflow-y: auto;
height: auto;
max-height: 200px;
"
>
<textarea cdkTextareaAutosize
matTextareaAutosize
matInput
formControlName="comment"
[required]="isCommentRequired()"
></textarea>
</div>