Skip to content

Commit

Permalink
fix(chips): chip-list doesn't pick up wrapped chips with ivy
Browse files Browse the repository at this point in the history
With Ivy, content queries no longer match nodes which
aren't direct children of the given component. This breaks
the chips as developers are currently able to have chips
wrapped by other elements (e.g. a `<div>`)
  • Loading branch information
devversion authored and jelbourn committed May 15, 2019
1 parent 58fc429 commit 7f12235
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/material/chips/chip-list.ts
Expand Up @@ -328,7 +328,11 @@ export class MatChipList extends _MatChipListMixinBase implements MatFormFieldCo
@Output() readonly valueChange: EventEmitter<any> = new EventEmitter<any>();

/** The chip components contained within this chip list. */
@ContentChildren(MatChip) chips: QueryList<MatChip>;
@ContentChildren(MatChip, {
// We need to use `descendants: true`, because Ivy will no longer match
// indirect descendants if it's left as false.
descendants: true
}) chips: QueryList<MatChip>;

constructor(protected _elementRef: ElementRef<HTMLElement>,
private _changeDetectorRef: ChangeDetectorRef,
Expand Down

0 comments on commit 7f12235

Please sign in to comment.