1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Remove label from material input on focus and when leave focus

Discussão em 'Angular' iniciado por prolina, Julho 10, 2025.

  1. prolina

    prolina Guest

    I am using angular material input with placeholder. When I focus on field I remove placeholder, but if I leave focus and field is empty I see transform animation, that I want to remove too. in this image placeholder that has to be when field is empty.

    [​IMG]

    And in this image I leave focus:

    [​IMG]

    <mat-form-field class="al-subscribe-form-field">
    <input formControlName="email" matInput type="email">
    <mat-placeholder class="al-placeholder">{{'SHARED.ENTER_YOUR_EMAIL' | translate}}</mat-placeholder>
    </mat-form-field>

    .mat-focused .al-placeholder, .mat-form-field-invalid .al-placeholder {
    display: none!important;
    }

    Continue reading...

Compartilhe esta Página