text area not growing in height when text is entered.

https://codepen.io/avinash-tallapaneni/pen/MWPyvQe i gave min-height:8rem and height: auto. when i enter text its not growing in height instead im getting scroll. how to fix this?
22 Replies
Chris Bolson
Chris Bolson2y ago
Hi. You are using a textarea to type into. I don’t think that, with CSS alone, it is possible to get it to automatically expand to fit its contents. You may need to look at a JavaScript solution.
13eck
13eck2y ago
If you want the text area to grow automatically without resorting to JavaScript I would suggest using the contenteditable attribute on a div. Also, instead of forcing a div to be a modal, you should be using the dialog element instead. It's a native HTML element designed specifically to do just that
Avinash
AvinashOP2y ago
i tried that. the issue is i need to offset the placeholder text when text is entered .. i didnt find resource online on how its done so i used textarea
13eck
13eck2y ago
What do you mean by "offset the placeholder"?
Avinash
AvinashOP2y ago
i found diff way to offset the label.. i originally had data-placeholder: text in div. so i used css if empty show the content before using content:attr(data-placeholder). so i wanted to move the placeholder text when text is entered. i couldnt fig it out so i used text area. now i just used label gave abs position to the contenteditable div and if div has text this label is being offset by y direction thumbup probably rambled a bunch of thing. my head is spinning for figuring things out
glutonium
glutonium2y ago
thus type of linking is new to discord right?? i assume it's only for pc now.. doesn't seem to be working on laptop nor mobile
13eck
13eck2y ago
It's only out to a few random servers. We have it here but it's not everywhere YouTube link Yep, posted that on mobile and it works fine
glutonium
glutonium2y ago
hmm..lemme try youtube aah yaa it works
13eck
13eck2y ago
BOOM!
glutonium
glutonium2y ago
lol
13eck
13eck2y ago
Micdrop :p
glutonium
glutonium2y ago
tnx xD it's weird how it's not on many server's
13eck
13eck2y ago
glutonium
glutonium2y ago
#head
13eck
13eck2y ago
The important thing is to have the https in the link. If there's no http/https discord doesn't recognize it as a URL
glutonium
glutonium2y ago
this was supposed to make text h1
13eck
13eck2y ago
You forgot the space # head
glutonium
glutonium2y ago
head
13eck
13eck2y ago
head
glutonium
glutonium2y ago
aah lol it's weird
13eck
13eck2y ago
We're getting way off-topic, though. If you want to play around with the new syntax feel free to use #off-topic or make a thread in #general
glutonium
glutonium2y ago
ya sure
Want results from more Discord servers?
Add your server