mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(chips): chip-list doesn't pick up wrapped chips with ivy
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>`)
This commit is contained in:
committed by
Jeremy Elbourn
parent
58fc42969e
commit
7f1223504f
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user