Skip to content

Nesting ng-content down to multiselect #12593

@klemenoslaj

Description

@klemenoslaj

Bug, feature request, or proposal:

Feature request / Proposal

What is the expected behavior?

Nested ng-content containing mat-option should properly appear in mat-autocomplete

What is the current behavior?

Content projection works fine, content is rendered and accessible via developer tools, but it doesn't get shown on input focus (visibility remains hidden).
When we manually add visibility: visible (while debugging) menu indeed appears, but click on mat-option has no effect.
Seems like mat-autocomplete fails to recognize it.

What are the steps to reproduce?

A very basic example of content projection nesting and reproduction steps available:
https://stackblitz.com/edit/angular-3ldpsb?file=app%2Fapp.component.html

What is the use-case or motivation for changing an existing behavior?

We should be able to wrap mat-autocomplete component in order to avoid code duplication. That component would then implement MatFormFieldControl, but this is the first issue to tackle.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular CLI: 6.1.2
Node: 8.11.3
OS: darwin x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.7.2
@angular-devkit/build-angular      0.7.2
@angular-devkit/build-ng-packagr   0.7.2
@angular-devkit/build-optimizer    0.7.2
@angular-devkit/build-webpack      0.7.2
@angular-devkit/core               0.7.2
@angular-devkit/schematics         0.7.2
@angular/cdk                       6.4.2
@angular/cli                       6.1.2
@angular/material                  6.4.2
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.1.2
@schematics/angular                0.7.2
@schematics/update                 0.7.2
ng-packagr                         3.0.6
rxjs                               6.2.2
typescript                         2.9.2
webpack                            4.9.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions