-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
textarea not manually resizable via resizeToFitContent method #2419
Comments
Was it fixed? I tried plunkr and it still doesn't trigger a change event and textarea doesn't resize automatically when inserting value through the code. In my project the same behavior... ps - also I noticed that plunkr isn't working when using md-input attribute but with mdInput works fine. Feature or bug? :) |
The fix has been published with beta.2 just yesterday. |
@mark-langer In the plunkr repo, autosize still isn't working with a new beta.2 release. |
@szykov updated your plnkr with edits to make it work |
@guojenman thanks for working example. I was expecting that it will trigger automatically resizing but manual call for resizeToFitContent is also fine. Thanks. |
@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 :/ |
Edit 2: If DefaultValueAccessor could fire an event on writeValue, we can listen and to respond to this. Considering requesting this feature to @angular/forms but I want to see if there's another way first. |
@gucheen Grrr I found another bug related to this one. I updated plunkr repo: This is what happens if resize manually: @devversion could you please reopen issue and help us? Thanks. |
Iam using material 2.0.0-beta6 have same error: There is no directive with "exportAs" set to "mdTextareaAutosize" |
Still not working beta 10.. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
According to the API, one should be able to call the method
resizeToFitContent
on theMdTextareaAutosize
directive to manually trigger an auto-resize of the textarea that is labeled withmd-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 propertyexportAs
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.
The text was updated successfully, but these errors were encountered: