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

Forms components not working on dynamic content #166

Closed
aimadnet opened this issue Dec 1, 2014 · 3 comments
Closed

Forms components not working on dynamic content #166

aimadnet opened this issue Dec 1, 2014 · 3 comments

Comments

@aimadnet
Copy link

aimadnet commented Dec 1, 2014

Hi
I use AngularJS in my project, I want to test materialize but I have some difficulty with form components.
To get this working, I have created a function to init all components after loading dynamic content.

function init_materialize()
{
Waves.displayEffect();
var text_inputs = $('input[type=text], input[type=password], input[type=email], textarea');
text_inputs.focus(function () {
$(this).siblings('label').addClass('active');
});
text_inputs.blur(function () {
if ($(this).val().length === 0) {
$(this).siblings('label').removeClass('active');
}
});
...
}

but I don't like this solution, is there a good way to fix it?

@Dogfalo
Copy link
Owner

Dogfalo commented Dec 1, 2014

Hey,
We do not yet have a good way of initializing forms dynamically. This is a problem we will fix.

@aimadnet
Copy link
Author

aimadnet commented Dec 1, 2014

Ok I'll wait for a next update, thank you

@Dogfalo
Copy link
Owner

Dogfalo commented Dec 19, 2014

fixed in 12345fb

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

No branches or pull requests

2 participants