diff --git a/src/lib/chips/chip-list.spec.ts b/src/lib/chips/chip-list.spec.ts index 25a0b60f2be..2ac30feb928 100644 --- a/src/lib/chips/chip-list.spec.ts +++ b/src/lib/chips/chip-list.spec.ts @@ -366,9 +366,9 @@ describe('MatChipList', () => { }); - it('should not float placeholder if no chip is selected', () => { + it('should float placeholder if chip is selected', () => { expect(formField.classList.contains('mat-form-field-should-float')) - .toBe(false, 'placeholder should not be floating'); + .toBe(true, 'placeholder should be floating'); }); it('should remove selection if chip has been removed', async(() => { diff --git a/src/lib/chips/chip-list.ts b/src/lib/chips/chip-list.ts index f419823e28f..040f862dabb 100644 --- a/src/lib/chips/chip-list.ts +++ b/src/lib/chips/chip-list.ts @@ -244,7 +244,7 @@ export class MatChipList implements MatFormFieldControl, ControlValueAccess } get shouldPlaceholderFloat(): boolean { - return this.empty; + return !this.empty || this.focused; } /** Whether this chip-list is disabled. */