Skip to content

Commit

Permalink
fix(form-field): ensure that descendants are picked up in Ivy (#17439)
Browse files Browse the repository at this point in the history
Since there's a slight difference in how `ContentChildren` works in Ivy, these changes add the `descendants` flag explicitly to ensure that we pick up all of the relevant elements. Note that we shouldn't need any extra logic, because nesting form fields is invalid.
  • Loading branch information
crisbeto authored and mmalerba committed Oct 18, 2019
1 parent 593a06c commit 1d40ec9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/material/form-field/form-field.ts
Expand Up @@ -270,10 +270,10 @@ export class MatFormField extends _MatFormFieldMixinBase
}

@ContentChild(MatPlaceholder, {static: false}) _placeholderChild: MatPlaceholder;
@ContentChildren(MatError) _errorChildren: QueryList<MatError>;
@ContentChildren(MatHint) _hintChildren: QueryList<MatHint>;
@ContentChildren(MatPrefix) _prefixChildren: QueryList<MatPrefix>;
@ContentChildren(MatSuffix) _suffixChildren: QueryList<MatSuffix>;
@ContentChildren(MatError, {descendants: true}) _errorChildren: QueryList<MatError>;
@ContentChildren(MatHint, {descendants: true}) _hintChildren: QueryList<MatHint>;
@ContentChildren(MatPrefix, {descendants: true}) _prefixChildren: QueryList<MatPrefix>;
@ContentChildren(MatSuffix, {descendants: true}) _suffixChildren: QueryList<MatSuffix>;

constructor(
public _elementRef: ElementRef, private _changeDetectorRef: ChangeDetectorRef,
Expand Down

0 comments on commit 1d40ec9

Please sign in to comment.