mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
* bug(chips): fixes placeholder in chip inputs #7481 * chore(nit): pr feedback * chore(tests): fix invalid test * chore(test): remove 'f'
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -244,7 +244,7 @@ export class MatChipList implements MatFormFieldControl<any>, ControlValueAccess
|
||||
}
|
||||
|
||||
get shouldPlaceholderFloat(): boolean {
|
||||
return this.empty;
|
||||
return !this.empty || this.focused;
|
||||
}
|
||||
|
||||
/** Whether this chip-list is disabled. */
|
||||
|
||||
Reference in New Issue
Block a user