Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Angular MDB Bootstrap autocomplete label not positioned right when bound to object

rctoone pro asked 7 years ago


So here is my code for mdb's autocomplete. <div class="md-form form-sm"> <mdb-completer [label]="'Month'"name="month" [(ngModel)]="productData.releaseDate [datasource]="months" [minSearchLength]="0"></mdb-completer> </div> The label isn't moving up and out of the way like it does on the other input fields when it is prefilled in by the ngModel directive. Is there a way to specify that the label should be minimized?  

rctoone pro commented 7 years ago

I have created a google doc that shows the issue more visually if this helps: https://docs.google.com/document/d/1q410eXiJC-PhyISZJKKEPGp5J2lNpUVZKT434wuHz1k/edit?usp=sharing

Witold Tkaczyk free answered 7 years ago


Hi,   I couldn't reproduce the issue but I think I know how to fix it. Just simply add [ngClass]="{ 'active': productData.releaseDate}" to your mdb-completer so it should look like this:  
<div class=”md-form form-sm”>
    <mdb-completer 
        [label]=”‘Month'”name=”month” 
        [ngClass]="{ 'active': productData.releaseDate}"  
        [(ngModel)]=”productData.releaseDate"  
        [datasource]=”months” 
        [minSearchLength]=”0″>
    </mdb-completer>
 </div>
I hope it helps Regards

rctoone pro commented 7 years ago

thanks, By adding the class active it is now working properly

Witold Tkaczyk free answered 7 years ago


Hello, could you send me your .ts and .html files so that I can reproduce the issue? It looks like id is duplicated or active class is missing. Regards

rctoone pro commented 7 years ago

Not sure where to send them too so here is a link to get to them. https://drive.google.com/open?id=0B8XfMmUFRKpIT0tmZ1l6VF96b2M


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Resolved

Specification of the issue

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