Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with selector? #27

Open
rafaelmoni opened this issue Aug 12, 2015 · 5 comments
Open

Problem with selector? #27

rafaelmoni opened this issue Aug 12, 2015 · 5 comments

Comments

@rafaelmoni
Copy link

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.

@ultimatedelman
Copy link
Owner

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

@rafaelmoni
Copy link
Author

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/

@ultimatedelman
Copy link
Owner

I'm not seeing that fiddle as functional :\

@rafaelmoni
Copy link
Author

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

@jonathanroy
Copy link

I am getting a similar error.

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants