# Textarea, adapt height to text lenght

**URL:** <https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 31, 2022, 11:19am UTC](https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861 "2022-03-31T11:19:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [March 31, 2022, 11:19am UTC](https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861/1 "2022-03-31T11:19:14Z")

</div>

Hi all,

I'm using a viewcanvas to list a set of views with a text area, in some ways like a feed/blog entry. I'd like to have the text field adjust the height to match the content text. The canvas will add scrollbars when needed.

Using a factor to the character count it sort of works, but I need to include component width as the resolution is not the same every time. Wrap is enabled. It has to be a TextArea to view the text correctly. markdown did not suit the application.

Can't find any setting to do this. Is there a way to do this that I don't see?

> if((len({this.props.text})/2.5)+"px"\<40,"40px",(len({this.props.text})/2.5)+"px")

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 31, 2022, 11:41am UTC](https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861/2 "2022-03-31T11:41:19Z")

</div>

dont think so, not without javascript,

you can let the user manualy resize the textarea tho with one of the properties  
(or add style resize:both

---

<div class="post-metadata">

**Author:** ![SBL\_MC](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sbl_mc/32/56813_2.png) [@SBL\_MC](https://forum.inductiveautomation.com/u/SBL_MC)\
**Post date:** [March 31, 2022, 11:53am UTC](https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861/3 "2022-03-31T11:53:34Z")

</div>

I wonder if there is a parameter for the TextArea that shows a line count?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [March 31, 2022, 11:55am UTC](https://forum.inductiveautomation.com/t/textarea-adapt-height-to-text-lenght/57861/4 "2022-03-31T11:55:34Z")

</div>

Nope, doesnt even exists in javascript, atleast not that is counting linewraps
