I’m trying to use the auto-height feature on the TextArea, but it’s not working as expected. I have some text already saved in the TextArea, but the field doesn’t automatically adjust its height based on the content. It also doesn’t seem to update when the text changes.
Could you please help me understand what might be causing this issue?
RadzenTextArea itself does not have a built-in auto-height feature - the "Auto-resize TextArea" example on our demo page is just a plain inline oninput handler that sets the height from scrollHeight. Our demo site now sends a strict Content Security Policy which blocks inline event handlers, so that example stopped working there. We will fix the demo.
In your own application the same approach works as long as you do not block inline scripts. Note that it only reacts to typing, so a value that is already present at render time will not be sized. If you target modern browsers, the simplest option is CSS:
.rz-textarea {
field-sizing: content;
}
This sizes the textarea to its content immediately, including pre-filled text, and shrinks it when text is deleted.