Topic: Class "active" is not set when using an input

Alexander Zaytsev free asked 7 years ago


I have a fairly simple layout:

<body><body>  
<app-root _nghost-c0="" ng-version="4.3.1"> <router-outlet _ngcontent-c0=""></router-outlet>
<ng-component> 
<div class="row" id="login"> 
<div class="col-md-6 offset-md-3"> 
            <div class="row"> 
              <div class="col-md-12"> 
                <form name="form" novalidate="" class="ng-dirty ng-valid ng-touched"> 
                 <div class="md-form"> 
                 <input class="form-control validate ng-dirty ng-valid ng-touched" id="f1" name="username" required="" type="text" ng-reflect-required="" ng-reflect-name="username" ng-reflect-model="asd"> 
                 <label for="f1" class="active">Username</label>
            </div>    
</form></div></div></div></div></ng-component></app-root>

When user types something in the textbox, the active class is not applied to the <label> and so it overlays the entered text.
Any suggestions?

Edyta Dabrowska free answered 7 years ago


Please add mdbActive to the input field and check if it is working as you like.

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No
Tags