Topic: mdb-completer label not positioned correctly when bound to object
Jared Bratu pro asked 7 years ago
<mdb-completer [label]="'Vehicle Make'" name="Make" id="Make" #Make="ngModel" (focusout)="controlLostFocus($event)" validateVehicleMake [(ngModel)]="vehicle.VehicleDetail.VehicleMake" [initialValue]="" [datasource]="vehicle_make_disp" [ngClass]="{ 'active': vehicle.VehicleDetail.VehicleMake }" [minSearchLength]="0"> </mdb-completer> <p *ngIf="Make.invalid" class="tags-inline-error">Invalid vehicle make</p>When vehicle.VehicleDetail.VehicleMake is loaded the label text is over the control value displayed. When I click on the control the label moves up to the correct position. How can I get the label to appear in the correct position without clicking the control?
Dawid Adach pro answered 7 years ago
Dear Jared Bratu,
You can apply a conditional class to label depending on variable value i.e.:
<label [class.active]="customer.name"for="name"class="active">Ad / Soyad veya Şirket Adı</label>
shampton3@gmail.com pro commented 6 years ago
Sounds like this is a workaround. Are there any plans for the mdb-completer label to behave like the other Reactive Form controls? If I the control with an initial value, via a bound formControlName, I would expect for the label to move above the text area.Damian Gemza staff commented 6 years ago
Dear shampton3@gmail.com, Which behavior exactly are you expecting? To lift-up label when prefilling with some data in Completer?FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes