Skip to content

Commit ce26cae

Browse files
authored
fix(input): floating placeholder on by default (#1619)
1 parent 437ec8e commit ce26cae

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/lib/input/input.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ describe('MdInput', function () {
7070
expect(fixture.debugElement.query(By.css('input'))).toBeTruthy();
7171
});
7272

73+
it('should default to flating placeholders', () => {
74+
let fixture = TestBed.createComponent(MdInputBaseTestController);
75+
fixture.detectChanges();
76+
77+
let mdInput = fixture.debugElement.query(By.directive(MdInput)).componentInstance as MdInput;
78+
expect(mdInput.floatingPlaceholder)
79+
.toBe(true, 'Expected MdInput to default to having floating placeholders turned on');
80+
});
81+
7382
it('should not be treated as empty if type is date', () => {
7483
if (isInternetExplorer11()) {
7584
return;

src/lib/input/input.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
167167
@Input() type: string = 'text';
168168
@Input() name: string = null;
169169

170-
private _floatingPlaceholder: boolean = false;
170+
private _floatingPlaceholder: boolean = true;
171171
private _autofocus: boolean = false;
172172
private _disabled: boolean = false;
173173
private _readonly: boolean = false;

0 commit comments

Comments
 (0)