I am loading text to an input box via the $("textarea").val(ajaxData);
however it will not autogrow, and my data is not fully displayed. Is there any method or anything that I can call to force an update?
There's indeed an internal function that is responsible for resizing, called resizeCheck()
. However, that function is a private implementation detail and is not exposed by the widget as a public method.
You can work around this, though: since resizeCheck()
is called by the widget's keyup
event handler, you can trigger that event yourself after setting the new value:
$("textarea").val(ajaxData).keyup();
This will resize the widget in the exact same way as if you had typed the new text "by hand".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With