Skip to content

Commit

Permalink
fix(input): floating placeholder on by default (#1619)
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn authored Oct 26, 2016
1 parent 437ec8e commit ce26cae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/lib/input/input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ describe('MdInput', function () {
expect(fixture.debugElement.query(By.css('input'))).toBeTruthy();
});

it('should default to flating placeholders', () => {
let fixture = TestBed.createComponent(MdInputBaseTestController);
fixture.detectChanges();

let mdInput = fixture.debugElement.query(By.directive(MdInput)).componentInstance as MdInput;
expect(mdInput.floatingPlaceholder)
.toBe(true, 'Expected MdInput to default to having floating placeholders turned on');
});

it('should not be treated as empty if type is date', () => {
if (isInternetExplorer11()) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
@Input() type: string = 'text';
@Input() name: string = null;

private _floatingPlaceholder: boolean = false;
private _floatingPlaceholder: boolean = true;
private _autofocus: boolean = false;
private _disabled: boolean = false;
private _readonly: boolean = false;
Expand Down

0 comments on commit ce26cae

Please sign in to comment.