Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(input): floating placeholder on by default #1619

Merged
merged 1 commit into from
Oct 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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