Question:
Is it possible to have a text box scale based on the number of lines, so that when a user is typing their message the box scales dynamically without just adding a scroll bar?
Product:
Wix Studio Editor
What are you trying to achieve:
I have a chat assistant setup on my website with an input box at the bottom of the screen (text box) allowing the user to type a message to the assistant. Currently the text box is scaled so that you can only see one line of text, once the user types a message reaching the end of the text box the text is wrapped to a new line and a little scroll bar appears on the right side of the text box. What I’d like to happen is for the text box to scale vertically making room for the additional line of text, until reaching a threshold, lets say 5 lines high, where it will no longer scale, and instead the scroll bar on the side will appear.
What have you already tried:
I have tried using java code on the page in order to have it scale based on the number of lines, as well as playing around with the min and max height of the text box, but nothing seems to work.
Additional information:
The text box already has some code applied to it as it’s the input box for the user to chat with the Ai assistant, I’m very new to programming so am not sure if this is relevant or needed to help answer my question.