question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

textarea not manually resizable via resizeToFitContent method

See original GitHub issue

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 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:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:11

github_iconTop GitHub Comments

1reaction
guojenmancommented, Feb 18, 2017

@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 😕

1reaction
guojenmancommented, Feb 16, 2017

@szykov updated your plnkr with edits to make it work http://plnkr.co/edit/w2qdyYJTtT6cg07MCZmU?p=preview

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery - resize() on a textarea doesn't detect manual resizing ...
The resize property does work. But the resize event is not fired when the user manually resizes the textArea. textArea was just the...
Read more >
How to Disable the Resizing of the <textarea> Element?
Use the CSS3 resize property with its "none" value to disable the resizing function of the textarea element. Learn the ways of only...
Read more >
Angular Material Textarea - ConcretePage.com
resizeToFitContent () method of CdkTextareaAutosize is used to resize the text area to fit its content. It accepts Boolean value. By passing true ......
Read more >
Text field - Angular Material
The resize logic can be triggered programmatically by calling resizeToFitContent . This method takes an optional boolean parameter force that defaults to ...
Read more >
resize - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The element offers no user-controllable method for resizing it. ... In many browsers, <textarea> elements are resizable by default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found