Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Switching off the floating label for Material Select in Angular 15?

This question indicates that it is possible to turn off the float for Angular Material and I tried it this solution:

.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,
  .mat-form-field-can-float .mat-input-server:focus + .mat-form-field-label-wrapper .mat-form-field-label{
    display: none !important;
  }

However no love. Here’s the stackblitz attempt. The SCSS is placed in styles.scss.

Anyone know if it’s possible to turn off the float for select fields in Angular 15?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

With the new API, it seems that to remove the floating placeholder, it should be

.mdc-notched-outline[ng-reflect-open='true'] .mdc-notched-outline__notch {
  display: none;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading