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 using cdkTextareaAutosize in the textarea as matInput, the placeholder was explicitly set as undefined and a value was patched, the placeholder shows 'undefined' after deleting the value (control still focused). All this happens as long as the control is focused. You can try it by typing another value and delete it again completely. The undefined placeholder disappears if the control loses focus (click somewhere else on the page). If you type a new value and delete it again, the placeholder is correct.
After removing all the cdk inputs (cdkTextareaAutosize, cdkAutosizeMinRows, cdkAutosizeMaxRows), the placeholder is correct (empty).
Reproduction
https://stackblitz.com/edit/angular-t7rq43?file=src/app/input-overview-example.html
Steps to reproduce:
- Open stackblitz example
- Delete the text in the textarea field
- Keep the focus in the control
- Optional: Type another value and delete it again
- Optional: Keep the focus in the control
Expected Behavior
No placeholder is shown even the placeholder is set as undefined
Actual Behavior
Placeholder shows text 'undefined'
Environment
- Angular: 12.2.15, 12.2.9, 12.1.0
- CDK/Material: 12.2.13, 12.2.9, 12.1.0
- Browser(s): Edge - Version 96.0.1054.62 (Official build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 - Version 2004 (OS Build 19041.1288)