InfomediaLtd / angular2-materialize

Angular 2 support for Materialize CSS framework.
https://infomedialtd.github.io/angular2-materialize/
MIT License
407 stars 140 forks source link

Textarea.trigger('autoresize') #416

Open Wouter8 opened 6 years ago

Wouter8 commented 6 years ago

Hi,

I've been searching for quite some time now. I found #168 which mentions the issue I'm having. Although the label for my textarea does go up the textarea doesn't resize.

In action:

Whenever I type the textarea does resize. I want it to do that automatically after the ngModel gets a value. I tried some things:

setTimeout(() => {
      $('#answer').trigger('keydown');
}, 1500);

$(document).ready(() => {
  $('#answer').trigger('autoresize');
  Materialize.updateTextFields();
})

Help would be appreciated.