You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
fix(input): Sizes textareas properly when the container is shown
Added an optional md-detect-hidden attribute for textareas inside of
md-input-containers. This will check on every digest cycle whether the
element was hidden and is now shown, and will auto-size the textarea
properly.
Fixes#1202. Closes#4726.
Copy file name to clipboardExpand all lines: src/components/input/input.js
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,7 @@ function labelDirective() {
126
126
* @param {string=} placeholder An alternative approach to using aria-label when the label is not
127
127
* PRESENT. The placeholder text is copied to the aria-label attribute.
128
128
* @param md-no-autogrow {boolean=} When present, textareas will not grow automatically.
129
+
* @param md-detect-hidden {boolean=} When present, textareas will be sized properly when they are revealed after being hidden. This is off by default for performance reasons because it guarantees a reflow every digest cycle.
129
130
*
130
131
* @usage
131
132
* <hljs lang="html">
@@ -341,6 +342,31 @@ function inputTextareaDirective($mdUtil, $window, $mdAria) {
341
342
varheight=node.offsetHeight+line;
342
343
node.style.height=height+'px';
343
344
}
345
+
346
+
// Attach a watcher to detect when the textarea gets shown.
0 commit comments