2 Replies Latest reply on Nov 17, 2007 7:00 AM by TeotiGraphix

    TextArea Height

    trycold Level 1

      I am inputting data in a textarea from my database. How can I adjust the height of the textarea according to the data in there so that the user don't get a scrollbar

        • 1. Re: TextArea Height
          If I were you, I would first keep the scrollbar on "auto", but make it invisible. Add an event listener that listens for if the scroll bar is there. If the scroll bar is there, call a recursive function that adds a certain height and rechecks to see if the scroll bar is still there. Have the function return once the scroll bar is no longer there.

          I am not sure of the code involved for that, but I think I would approach it that way.

          Best of luck to you!
          • 2. Re: TextArea Height
            TeotiGraphix Level 3

            Why are you using a TextArea?

            This sounds like an instance where you should use the Text component.

            Set it's width to 100% and the height will automatically adjust to the new text inserted.