components icon indicating copy to clipboard operation
components copied to clipboard

mat-select doesn't open.

Open nicbil opened this issue 8 years ago • 5 comments

Bug: mat-select doesn't open. Demonstration - https://www.youtube.com/watch?v=hLCWMniUszg

selector: "fr-input-select",
template: 
    <mat-form-field>
        <mat-select class="fr-input-select"
                   [name]="md?.md?.name"
                   [placeholder]="md?.md?.caption"
                   [disabled]="disabled ? 'disabled': undefined"
                   [required]="validationRules?.required?.rule"
                   [(ngModel)]="selectedItem">
            <mat-option [value]=""></mat-option>
            <mat-option
                    class="fr-input-select__items"
                    *ngFor="let item of md?.md?.items"
                    [value]="item">
                {{item}}
            </mat-option>
        </mat-select>
    </mat-form-field>

What is the expected behavior? when I open the select don't see list. Only after other event.

Which versions of Angular, Material, OS, TypeScript, browsers are affected? "@angular/animations": "^4.4.6", "@angular/cdk": "^5.0.2", "@angular/common": "^4.3.6", "@angular/compiler": "^4.3.6", "@angular/core": "^4.3.6", "@angular/forms": "^4.3.6", "@angular/http": "^4.3.6", "@angular/material": "^5.0.2", "@angular/platform-browser": "^4.3.6", "@angular/platform-browser-dynamic": "^4.3.6",

Is there anything else we should know? Building of component on the fly.

nicbil avatar Jan 03 '18 08:01 nicbil

The select usually won't open if it doesn't have any options. Are you sure that anything is being rendered?

crisbeto avatar Jan 03 '18 09:01 crisbeto

@crisbeto sure i have options.

<mat-option  [value]=""></mat-option>

<mat-option class="fr-input-select__items" *ngFor="let item of md?.md?.items" [value]="item">{{item}}
</mat-option>

you can watch https://www.youtube.com/watch?v=hLCWMniUszg

nicbil avatar Jan 03 '18 09:01 nicbil

@bilenko-git, there are somethings you can check:

  1. Have you double checked whether your angular version is correct (you need @angular >= 5.0.0 for @angular/material 5.0.2 and maybe you're using an old or cached version)? Inspect it: ng -v (suposing you're using angular/cli)
  2. Before you npm install your project (suposing you did it): 2.1. Have you deleted node_modules? 2.2. Have you deleted package-lock.json (if you have one)?
  3. If you used ng build --prod to generate the bundles make sure angular/cli >= 1.6.3. There's a bug in previous versions caused by uglify-es.

julianobrasil avatar Jan 03 '18 09:01 julianobrasil

Closing since there's not much we can do without a repro case.

crisbeto avatar Jan 10 '18 20:01 crisbeto

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.