bug(cdkTextareaAutosize): Autosize does not properly compute line heights when min-height or height is set via css
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
When `height` or `min-height` is set on a `textarea`, cdkTextareaAutosize does not properly calculate the line height.
I have a pull request ready to fix this issue, and will submit it shortly.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-mopjkj?file=src%2Fapp%2Fexample-component.css
### Expected Behavior
`height` and `min-height` should not affect the line height used to calculate the height based on min rows.
### Actual Behavior
`height` and `min-height` do affect the line height.
### Environment
- Angular: 16.2
- CDK/Material: 16.2
- Browser(s): Chrome (current)
Contributor guide
Research direction
Start with the cdkTextareaAutosize implementation and reproduce the behavior using the linked StackBlitz example, especially its src/app/example-component.css. Verify how CSS height and min-height affect the calculated line height, then confirm that min-row sizing no longer uses those values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100