-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
mdTextareaAutosize doesn't work when changing a FormControl instance #5247
Comments
Dupe of #4657 |
@jelbourn i saw this issue, but this one is about template-driven forms and mine is about reactive forms. |
I believe it's the same underlying cause |
@jelbourn I see that it has been opened for more than a month. Do you guys have any plans on fixing it? It's not just a minor bug since it misleads the user to think there is only one row of text whereas the rest is hidden. |
@eyalhakim here is an example of a workaround until it is fixed |
@willshowell Thank you very much! |
@willshowell also, this doesn't work well when changing the entire form group like in my example. |
@eyalhakim you can use Also, you're right. You will have to call |
@willshowell Thanks again! If i do so immediately after instantiating the FormGroup, it doesn't work because the new value was not bound to the input yet. The valueChanges event is not called on first value initialization. Currently, i simply call it after 50ms using setTimeout but that is a very ugly solution. Do you have a better one? |
Off the top of my head, another (very lame, not better) solution I could think of would be to use an Alternatively, use the FormGroup api for But really, your best bet is to just wait until until #5315 is merged in the next couple days. |
@willshowell perfect, will wait. Thank you! |
@willshowell Hi, i just installed the new version and the issue still exists. Thanks |
@eyalhakim Yeah you're right... @jelbourn could you reopen? This updated plunker demos the original issue with master build |
@jelbourn Hi, was wondering if you have an intention to fix this one soon? |
@willshowell Hi, same question as above? |
Can't speak for Jeremy, but I'll try to take a look as soon as #5692 is merged. |
Fixes the textarea autosize directive not resizing when the value is changed programmatically outside Angular (e.g. `element.value`) or when the form control is swapped out. Fixes angular#5247.
Fixes the textarea autosize directive not resizing when the value is changed programmatically outside Angular (e.g. `element.value`) or when the form control is swapped out. Fixes #5247.
Fixes the textarea autosize directive not resizing when the value is changed programmatically outside Angular (e.g. `element.value`) or when the form control is swapped out. Fixes #5247.
@jelbourn Hi! Issue still persist in beta 10. Is the fix part of it? Thanks |
@eyalhakim it was merged just after the beta 10 release Not working with beta 10: http://plnkr.co/edit/roR3rA3GryBk3r4pR1Ro?p=preview |
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?
When changing the instance of the FormControl bound to the input, the input should resize according to the new value.
What is the current behavior?
The input does not resize
What are the steps to reproduce?
http://plnkr.co/edit/WJhcpwRK001maYYnu8AK?p=preview
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: