0

So I have an input field that I want to have its height expand when the content in the input field overflows kind of like discords input field when you message in a channel if the content overflow on the x axis the height automatically increases.

I am using tailwind css and it must specifically be an input because of how i have my entire form designed

Does anyone know how to do this?

  • Does this answer your question? [Creating a textarea with auto-resize](https://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize) – Mehdi Dehghani Sep 25 '22 at 08:50
  • No I need an input field because of how i have designed my entire form I need it to be an input field –  Sep 25 '22 at 09:14

1 Answers1

0

Try adding word-wrap: break-word; min-height: <default height>; max-height: <maxiumum expanded height>; to the styles for your input field.

YesWeDont
  • 106
  • 2
  • No it still doesn't work –  Sep 25 '22 at 09:13
  • [Wrapping text inside input type="text" element HTML/CSS](https://stackoverflow.com/questions/5286663/wrapping-text-inside-input-type-text-element-html-css) It has to be a – YesWeDont Sep 25 '22 at 09:50
  • So it's imposible to have the feature without it being a textarea? –  Sep 25 '22 at 09:58