Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/chips/chip-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface MatChipInputEvent {
'(keydown)': '_keydown($event)',
'(blur)': '_blur()',
'(focus)': '_focus()',
'(input)': '_onInput()',
}
})
export class MatChipInput {
Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -115,5 +116,10 @@ export class MatChipInput {
}
}

_onInput() {
// Let chip list know whenever the value changes.
this._chipList.stateChanges.next();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a unit test for this?

}

focus() { this._inputElement.focus(); }
}