padolsey/jQuery.fn.autoResize — Issue #35: Autoresize not applied when input element is initially hidden
Author: mschwarz
Created: 2011-12-22 14:36:19+00:00
State: open

I have a page with a textarea which has a style attribute of "display: none;" on which I apply autoResize(...).
If I then trigger a keyup on the textarea the clone gets created but since its style attributes are being copied from the original input field it also has the display: none; attribute. This leads to the problem that clone[0].scrollTop always returns 0 and thus the visible textarea is never resized.

As a quick fix I added the following line after line #153:
clone.css("display", "block");

This is however dangerous as it may break functionality for other elements than textareas.

Please make sure that the cloned element does not have the "display: none" style attribute as this breaks functionality.

I'd be able to submit a code sample which shows the incorrect behavior.