-
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
make matTextareaAutosize bindable #9884
Comments
That sounds reasonable to me, want to send a PR? |
Just started working on this. What is the expected result when autosizing is disabled but the height already changed through the autosizing. I would assume we restore the original height of the element by removing the style.height property again. Also on contrary to the initial description the changes have to be applied in CdkTextareaAutosize, but we should probably extend the functionality into MatTextareaAutosize. @shlomiassaf Regarding your question with multiple selectors: We can just have two property setter (one for each selector) which internally map to same code (which enables / disables the autosizing) |
This allows cdkTextareaAutosize selector to be bindable and toggle the internal enabled / disabled state. Upon disabling the initial height is restored (textarea.style.height before any changes were applied). Also added wrapper into (to be discontinued) matTextareaAutosize. Fixes angular#9884 Currently missing unit tests, thus still WIP. Manual tests in demo-app seem to work as expected
This allows cdkTextareaAutosize selector to be bindable and toggle the internal enabled / disabled state. Upon disabling the initial height is restored (textarea.style.height before any changes were applied). Also added wrapper into (to be discontinued) matTextareaAutosize. Fixes angular#9884 Currently missing unit tests, thus still WIP. Manual tests in demo-app seem to work as expected
This allows cdkTextareaAutosize selector to be bindable and toggle the internal enabled / disabled state. Upon disabling the initial height is restored (textarea.style.height before any changes were applied). Also added wrapper into (to be discontinued) matTextareaAutosize. Fixes angular#9884 Currently missing unit tests, thus still WIP. Manual tests in demo-app seem to work as expected
* feat(cdk-input): change autosize to be bindable (#9884) This allows cdkTextareaAutosize selector to be bindable and toggle the internal enabled / disabled state. Upon disabling the initial height is restored (textarea.style.height before any changes were applied). Also added wrapper into (to be discontinued) matTextareaAutosize. Fixes #9884 Currently missing unit tests, thus still WIP. Manual tests in demo-app seem to work as expected * Small code quality improvements (#9884)
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: proposal
What is the expected behavior?
When using
matTextareaAutosize
, the auto size feature can be enabled/disabled based on bindings.What is the current behavior?
matTextareaAutosize
is not bindable.What is the use-case or motivation for changing an existing behavior?
Controlling the auto-size feature can allow smart layouts based on media queries, or any other logic the user implements. It also allows dynamic forms to set it on/off based on schema selection.
Another thing is that the
matTextareaAutosize
directive is a bit misleading, one might easily think it is a property ofmatInput
.This should be fairly easy to implement, I think just adding an
@Input() matTextareaAutosize: boolean
will do the trick, usingtrue
as the initial value and coercion when set.There is one issue with the duplicate selectors (
textarea[mat-autosize], textarea[matTextareaAutosize]
) which I have no clue how the end result is when someone will do[mat-autosize]="autoSize
Also related #9831
cc @jelbourn @mmalerba
The text was updated successfully, but these errors were encountered: