Feature Request: Auto resize RadzenTextArea #1229

Closed
opened 2026-01-29 17:50:45 +00:00 by claunia · 0 comments
Owner

Originally created by @KaleyBM-FSB on GitHub (May 6, 2024).

Is your feature request related to a problem? Please describe.
If a user opens a page that contains a textarea with existing content, they must manually resize the textarea to view the entirety of the content.

Describe the solution you'd like
The textarea automatically resizes on render:
Add a boolean parameter to RadzenTextArea called AutoResize.
If this parameter is true, in the OnAfterRenderAsync method use JavaScript to resize the textarea.
The JS method:

textareaResize: function(id) {
     var el = document.getElementById(id);
     if (el.scrollHeight > el.clientHeight) {
         el.style.height = "";
         el.style.height = el.scrollHeight + "px";
     }
},

This could be taken even further by calling this JS method when the onchange event is fired, but I believe resizing on render would help the most.

Originally created by @KaleyBM-FSB on GitHub (May 6, 2024). **Is your feature request related to a problem? Please describe.** If a user opens a page that contains a textarea with existing content, they must manually resize the textarea to view the entirety of the content. **Describe the solution you'd like** The textarea automatically resizes on render: Add a boolean parameter to RadzenTextArea called AutoResize. If this parameter is true, in the OnAfterRenderAsync method use JavaScript to resize the textarea. The JS method: ``` textareaResize: function(id) { var el = document.getElementById(id); if (el.scrollHeight > el.clientHeight) { el.style.height = ""; el.style.height = el.scrollHeight + "px"; } }, ``` This could be taken even further by calling this JS method when the onchange event is fired, but I believe resizing on render would help the most.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1229