Skip to content

Commit f253d2c

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 f253d2c

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/lib/input/autosize.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {MdInputModule} from './input';
55
import {MdTextareaAutosize} from './autosize';
66

77

8-
describe('MdTextareaAutosize', () => {
8+
fdescribe('MdTextareaAutosize', () => {
99
let fixture: ComponentFixture<AutosizeTextAreaWithContent>;
1010
let textarea: HTMLTextAreaElement;
1111
let autosize: MdTextareaAutosize;
@@ -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)