Closed optyler closed 5 years ago
I didn't find a better way to do it.
There likely isn't a better way to do it. This entire project is trying to use materializecss in a way it was never designed to, so sometimes ugly hacks are just necessary.
Thanks for a very well explained pull-request.
In the current master of
angular-materialize
+ the current dependency to thematerialize-0.98.2
textarea autoresize did not work. This is caused by required init values that are undefined.Here are the changes made on
materialize
lib from the0.97.8
and the0.98.2
you could see what have changed : https://github.com/Dogfalo/materialize/compare/v0.97.8...v0.98.2#diff-338f03716a63d52eee0f79b4510d617cR156Here are the lines that should init the
textarea
onload
but due to lifecycle they are not set properly : https://github.com/Dogfalo/materialize/blob/138be0b945cc8e1ee24d76ab6c1240c3f3628565/js/forms.js#L175-L176In the
materializecss
library, these 2 lines should init textarea values on dom content loaded, but due to angular lifecycle, these values are alwaysundefined
on dom content loaded, don't know exactly why because they are already encapsulated in a$timeout
...However, the changes made in this commit fixes the directive.
I didn't find a better way to do it.