padolsey/jQuery.fn.autoResize — Issue #39: data('AutoResizer').check() Error:  Line 260 => this.clone.remove();
Author: wwjamieson3
Created: 2012-01-18 03:00:55+00:00
State: open

When the page is initially loaded I call this:

$('.growfield').autoResize({maxHeight: 5000});

Then as the user interacts with the application, various text areas are hidden and revealed. An example would be should below:

$('#dmiCodesContainer').show();
$('#workforceNotes').show();
$('textarea.growfield').autoResize({maxHeight: 5000, minHeight: 125});
$('textarea.growfield').data('AutoResizer').check();

However this code throws the following error when running the data('AutoResizer').check() function
=> TypeError: 'undefined' is not an object (evaluating 'this.clone.remove')

This breaks the functionality, meaning that the targeted text areas will not resize appropriately.

I have found that commenting out the following line seems to rectify the issue.
Line 260 => this.clone.remove();

So far I know that this problem exists on Safari 5 on mac and Firefox 3.6 on Windows XP

Keen to hear your thoughts