From 31d41c9a097a28ebd7bf68fc1418ec66314ee7a6 Mon Sep 17 00:00:00 2001 From: Yuan Gao Date: Wed, 15 Nov 2017 17:52:29 -0800 Subject: [PATCH] fix(chip): fix placeholder and text overlap --- src/lib/chips/chip-input.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/chips/chip-input.ts b/src/lib/chips/chip-input.ts index 6e3ec4ca6613..1bc9492a1e1e 100644 --- a/src/lib/chips/chip-input.ts +++ b/src/lib/chips/chip-input.ts @@ -29,6 +29,7 @@ export interface MatChipInputEvent { '(keydown)': '_keydown($event)', '(blur)': '_blur()', '(focus)': '_focus()', + '(input)': '_onInput()', } }) export class MatChipInput { @@ -68,7 +69,7 @@ export class MatChipInput { get empty(): boolean { let value: string | null = this._inputElement.value; - return value == null || value === ''; + return (value == null || value === ''); } /** The native input element to which this directive is attached. */ @@ -115,5 +116,10 @@ export class MatChipInput { } } + _onInput() { + // Let chip list know whenever the value changes. + this._chipList.stateChanges.next(); + } + focus() { this._inputElement.focus(); } }