components icon indicating copy to clipboard operation
components copied to clipboard

mat-select not giving underline and placeholder

Open Anoop-Goudar opened this issue 9 years ago • 7 comments

Bug, feature request, or proposal:

Underline for the dropdown is not rendering and placeholder value is not displaying, please see the code below


<mat-select *ngIf="someCheck" 
  (ngModelChange)="updateonchange()" 
  [(ngModel)]="selectedvalue">
   <mat-option>
          Test
   </mat-option>
   <mat-option>
          Test1
   </mat-option>
</mat-select>

What is the expected behavior?

It was working fine with md-select, after the updating to the latest release, I am having this issue

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

"@angular/material": "^5.0.0-rc0", "@angular/animations": "^5.0.1", "@angular/cli": "^1.5.0", "typescript": "^2.6.1"

using Ubuntu and Google Chrome

Is there anything else we should know?

Please check the screen shot nounderline

Anoop-Goudar avatar Nov 16 '17 11:11 Anoop-Goudar

mat-select must appear inside a mat-form-field from beta 12

benb7760 avatar Nov 16 '17 11:11 benb7760

@benb7760 is correct that you need to wrap your select in a mat-form-field. Also you need to import the MatSelectModule and MatFormFieldModule in your app.

crisbeto avatar Nov 16 '17 12:11 crisbeto

Thanks! That's the issue.

Anoop-Goudar avatar Nov 16 '17 12:11 Anoop-Goudar

You should update examples on https://material.angular.io

kaziupir avatar Nov 16 '17 15:11 kaziupir

@kaziupir it's likely a caching issue in your browser - it's affected a lot of people recently. the examples are correct when I browse in incognito mode

benb7760 avatar Nov 16 '17 15:11 benb7760

@benb7760 thanks

finalxcode avatar Nov 29 '17 05:11 finalxcode

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.