Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Auto resize RadzenTextArea #1501

Open
KaleyBM-FSB opened this issue May 6, 2024 · 0 comments
Open

Feature Request: Auto resize RadzenTextArea #1501

KaleyBM-FSB opened this issue May 6, 2024 · 0 comments

Comments

@KaleyBM-FSB
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant