Skip to content

Commit 65c166d

Browse files
committed
update md-chip-list implementation of MdFormFieldControl
1 parent 130c25b commit 65c166d

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
@@ -88,6 +88,7 @@ export class MdChipListChange {
8888
})
8989
export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor,
9090
AfterContentInit, OnInit, OnDestroy {
91+
readonly controlType = 'mat-chip-list';
9192

9293
/**
9394
* Stream that emits whenever the state of the input changes such that the wrapping `MdFormField`
@@ -245,6 +246,10 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
245246
return (!this._chipInput || this._chipInput.empty) && this.chips.length === 0;
246247
}
247248

249+
get shouldPlaceholderFloat(): boolean {
250+
return this.empty;
251+
}
252+
248253
/** Whether this chip-list is disabled. */
249254
@Input()
250255
get disabled() { return this.ngControl ? this.ngControl.disabled : this._disabled; }
@@ -394,6 +399,10 @@ export class MdChipList implements MdFormFieldControl<any>, ControlValueAccessor
394399
this.stateChanges.next();
395400
}
396401

402+
onContainerClick() {
403+
this.focus();
404+
}
405+
397406
/**
398407
* Focuses the the first non-disabled chip in this chip list, or the associated input when there
399408
* are no eligible chips.

0 commit comments

Comments
 (0)