Skip to content

Commit 16b2172

Browse files
committed
update md-chip-list implementation of MdFormFieldControl
1 parent 02cd9d3 commit 16b2172

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/lib/chips/chip-list.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class MdChipListChange {
8181
})
8282
export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor,
8383
AfterContentInit, OnInit, OnDestroy {
84+
readonly controlType = 'mat-chip-list';
8485

8586
/**
8687
* Stream that emits whenever the state of the input changes such that the wrapping `MdFormField`
@@ -238,6 +239,10 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
238239
return (!this._chipInput || this._chipInput.empty) && this.chips.length === 0;
239240
}
240241

242+
get shouldPlaceholderFloat(): boolean {
243+
return this.empty;
244+
}
245+
241246
/** Whether this chip-list is disabled. */
242247
@Input()
243248
get disabled() { return this.ngControl ? this.ngControl.disabled : this._disabled; }
@@ -387,6 +392,10 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
387392
this.stateChanges.next();
388393
}
389394

395+
onContainerClick() {
396+
this.focus();
397+
}
398+
390399
/**
391400
* Focuses the the first non-disabled chip in this chip list, or the associated input when there
392401
* are no eligible chips.

0 commit comments

Comments
 (0)