File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/material-experimental/mdc-chips Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,10 @@ export class MatChipGrid extends _MatChipGridMixinBase implements AfterContentIn
154
154
* Implemented as part of MatFormFieldControl.
155
155
* @docs -private
156
156
*/
157
- get empty ( ) : boolean { return this . _chipInput . empty && this . _chips . length === 0 ; }
157
+ get empty ( ) : boolean {
158
+ return ( ! this . _chipInput || this . _chipInput . empty ) &&
159
+ ( ! this . _chips || this . _chips . length === 0 ) ;
160
+ }
158
161
159
162
/** The ARIA role applied to the chip grid. */
160
163
get role ( ) : string | null { return this . empty ? null : 'grid' ; }
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export class MatChipSet extends _MatChipSetMixinBase implements AfterContentInit
193
193
194
194
/** Checks whether any of the chips is focused. */
195
195
protected _hasFocusedChip ( ) {
196
- return this . _chips . some ( chip => chip . _hasFocus ) ;
196
+ return this . _chips && this . _chips . some ( chip => chip . _hasFocus ) ;
197
197
}
198
198
199
199
/** Syncs the chip-set's state with the individual chips. */
You can’t perform that action at this time.
0 commit comments