nz-input textarea + cdkTextareaAutosize replacement for deprecated component is showing unwanted scroll
Author: a-studentCreated Sep 2, 2026Updated Sep 2, 2026
nz-input textarea + cdkTextareaAutosize replacement for deprecated component is showing unwanted scroll
ng-zorro v22.0.1
Link to minimal reproduction
- https://ng.ant.design/components/input/en Scroll to Autosizing the height to fit the content -or-
- https://qrcode.expert Select Static Text
Sample code
<textarea
nz-input
placeholder="Autosize height with minimum and maximum number of lines"
cdkTextareaAutosize
cdkAutosizeMinRows="2"
cdkAutosizeMaxRows="6"
></textarea>
Steps to reproduce
- Type several lines into textarea less than
cdkAutosizeMaxRows
What is expected?
No scroll appears until cdkAutosizeMaxRows is reached, textarea height is increased accordingly.
What is actually happening?
Vertical scroll bar appears after typing 2 lines.
https://github.com/user-attachments/assets/21a75a8e-83e5-4ff9-90eb-109fd4537606
Source: NG-ZORRO/ng-zorro-antd