Reputation: 620
I'm trying to make a Message Contact Form with a textarea that automatically resizes according to the content inserted. I.e. as the user types in the message, the textarea resizes to fit the message.
For this, I was searching StackOverflow and found this answer.
However, when implementing the JavaScript snippet used there I get a textarea that resizes constantly, upon every keyup
action. This is happening when I set the textarea to update with CSS easing. If I just let it resize with no "jaggedly", everything goes fine... but looks less elegant.
You can see what's going on here, in this jsFiddle I've worked up.
Perhaps somebody out there can see what's going on here!
Upvotes: 1
Views: 120
Reputation: 393
You better use a jquery plugin for resizing height of the textarea. I personally recommend this: http://www.jacklmoore.com/autosize
Upvotes: 2