Topic: How to set style for complete-holder, input and label
osoverflow pro asked 7 years ago
<div class="form-row"> <div class="col-md-6"> <div class="md-form"> <i class="fa fa-globe prefix grey-text"></i> <mdb-completer mdbActive mdbInputValidate [label]="labels.country" name="country" formControlName="country" [datasource]="countries" [minSearchLength]="0" inputClass="form-control"></mdb-completer> </div> </div> </div>And the problem is that the fa icon is overlapped with the completer. On the mdb-date-picker i used an style to push the field, but on the mdb-completer I can't push it This is the style I'm using
mdb-date-picker { border: 0; padding-left: 3rem; } mdb-completer { padding-left: 3rem; } .completer-holder { border: 1px solid red; }And this is an screenshot of the part of the form. https://www.dropbox.com/s/l42ffff1so7s5tb/Screenshot%202018-03-15%2016.18.54.png?dl=0
Damian Gemza staff answered 7 years ago
<div class="md-form input-group"> <mdb-completer [label]="'Select color'" initialValue="Select color" name="autocomplete" [(ngModel)]="searchStr" [datasource]="dataService" [minSearchLength]="0"> </mdb-completer> <div class="input-group-append" id="basic-addon2"> <i class="fa fa-globe prefix grey-text"></i> </div> </div>
osoverflow pro answered 7 years ago
<div class="form-row"> <div class="col-md-6"> <div class="md-form input-group"> <div class="input-group-append" id="basic-addon-country"> <i class="fa fa-globe prefix grey-text"></i> </div> <mdb-completer mdbActive mdbInputValidate [label]="labels.country" name="country" formControlName="country" [datasource]="countries" [clearUnselected]="true" [inputClass]="register-completer" [minSearchLength]="0"></mdb-completer> </div> </div> </div>the component.scss
mdb-completer { padding-left: 3rem; } .md-form.input-group { padding-left: 0; } input.register-completer { border: 1px solid red; }
Damian Gemza staff commented 7 years ago
Dear Osoverflow, I've prepared a fix for clearUnselected in completer. Please head into pro/autocomplete/directives/input.directive.ts file, and in 'blur' HostListener, in below line 140 if (this.clearUnselected && !this.completer.hasSelected) please paste this code: this.el.nativeElement.value = ''; Then save changes and try one more time. For me it work. It will be added in next release. Best Regards, Damianosoverflow pro commented 7 years ago
Ok, the clearUnselected works now. Persist the labelDamian Gemza staff answered 7 years ago
osoverflow pro commented 7 years ago
The label problem seems to be that it works detecting that the field is focused, but not that the field has content. When it has content the label should be up, and on this case the label don't detect that and stays down.osoverflow pro answered 7 years ago
Damian Gemza staff commented 7 years ago
Dear Osoverflow, that was a bug. It's fixed right now, and available to download from our GitLab branch dev. Feel free to update your project. Best Regards, DamianFREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No