textarea not manually resizable via resizeToFitContent method
See original GitHub issueBug, feature request, or proposal:
Bug
What is the expected behavior?
According to the API, one should be able to call the method resizeToFitContent
on the MdTextareaAutosize
directive to manually trigger an auto-resize of the textarea that is labeled with md-autosize
.
Since you have to declare a handle for the directive through a template variable, e. g. #myTextareaAutosizeDirective="mdTextareAutosize"
, to call any methods on it, the MdTextareaAutosize directive should have a decorator property exportAs
defined.
What is the current behavior?
If you try to assign the directive to a template variable, an error is thrown. I assume this error occurs because of the directive’s missing exportAs decorator property mentioned above.
The error reads: There is no directive with "exportAs" set to "mdTextareaAutosize"
What are the steps to reproduce?
This plunker shows the use case.
This plunker includes the template variable assignment that throws the error.
What is the use-case or motivation for changing an existing behavior?
In our app, we insert text into the textarea through a function which does not trigger the change
event of the textarea that is normally used for resizing.
Which versions of Angular, Material, OS, browsers are affected?
beta.0
Is there anything else we should know?
Nope.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:11
Top GitHub Comments
@szykov Yeah, I was expecting that too. Maybe this directive needs to respond to ngModelChange event
Edit 1: was going to try to modify source but realized ngModelChange is out changes and what we want is in (programmatically) changes 😕
@szykov updated your plnkr with edits to make it work http://plnkr.co/edit/w2qdyYJTtT6cg07MCZmU?p=preview