Skip to content

Commit c7d9792

Browse files
committed
refactor: changed minRows and maxRows to mdAutosizeMinRows and mdAutosizeMaxRows
- left minRows and maxRows to not break old versions
1 parent b49bfce commit c7d9792

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/lib/input/autosize.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const textareaStyleReset = `
116116

117117
@Component({
118118
template: `
119-
<textarea mdTextareaAutosize [minRows]="minRows" [maxRows]="maxRows"
119+
<textarea mdTextareaAutosize [mdAutosizeMinRows]="minRows" [mdAutosizeMaxRows]="maxRows"
120120
#autosize="mdTextareaAutosize">
121121
{{content}}
122122
</textarea>`,

src/lib/input/autosize.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,27 @@ import {Directive, ElementRef, Input, OnInit} from '@angular/core';
1515
})
1616
export class MdTextareaAutosize implements OnInit {
1717
/** Minimum number of rows for this textarea. */
18-
@Input() minRows: number;
18+
@Input() minRows: number
19+
20+
get mdAutosizeMinRows(): number {
21+
return this.minRows;
22+
}
23+
24+
@Input() set mdAutosizeMinRows(value: number) {
25+
this.minRows = value;
26+
}
1927

2028
/** Maximum number of rows for this textarea. */
2129
@Input() maxRows: number;
2230

31+
get mdAutosizeMaxRows(): number {
32+
return this.maxRows;
33+
}
34+
35+
@Input() set mdAutosizeMaxRows(value: number) {
36+
this.maxRows = value;
37+
}
38+
2339
/** Cached height of a textarea with a single row. */
2440
private _cachedLineHeight: number;
2541

0 commit comments

Comments
 (0)