autogrow icon indicating copy to clipboard operation
autogrow copied to clipboard

Problem with selector?

Open rafaelmoni opened this issue 10 years ago • 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.

rafaelmoni avatar Aug 12 '15 14:08 rafaelmoni

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

ultimatedelman avatar Aug 12 '15 16:08 ultimatedelman

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/

rafaelmoni avatar Aug 12 '15 16:08 rafaelmoni

I'm not seeing that fiddle as functional :\

ultimatedelman avatar Aug 12 '15 20:08 ultimatedelman

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

rafaelmoni avatar Aug 12 '15 20:08 rafaelmoni

I am getting a similar error.

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

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

jonathanroy avatar Jan 11 '16 20:01 jonathanroy