ultimatedelman/autogrow

Problem with selector?

rafaelmoni opened this issue · 5 comments

I'm trying to use autogrow with a lot of other plugins together, but when I try to use a custom jquery selector, it doesn't work.
I created a html attribute on the textarea to control who already has autogrow and who's doesn't.

console.log($('.tarea_marcacao')); // return all textareas
console.log($('.tarea_marcacao[appliedAutogrow="false"]')); // return the same all textareas

$('.tarea_marcacao').autogrow({ //works
    onInitialize: true,
    fixMinHeight:true
});

$('.tarea_marcacao[appliedAutogrow="false"]').autogrow({ //nothing happens...
    onInitialize: true,
    fixMinHeight:true
});

I also tryed to use it inside a $.each loop, but it didn't worked too

$('.tarea_marcacao[appliedAutogrow="false"]').each(function(){
    $(this).autogrow({ //doesn't work either....
        onInitialize: true,
        fixMinHeight:true
    });
});

Thanks.

Can you post a fiddle? If you're trying to init the same textareas twice, this might be expected behavior...

This is the simplest way to simulate the problem, I don't wanna init twice, that's why I use the attr :)
http://jsfiddle.net/rafaelmoni/uvxou5yt/1/

I'm not seeing that fiddle as functional :\

Am I using the plugin wrongly?
Take a look now:
http://jsfiddle.net/rafaelmoni/uvxou5yt/

I am getting a similar error.

$('textarea').autogrow(); // works on all textarea

$('textarea').not('.no-autogrow').autogrow(); // does not work on any textarea