Mdb Select Form reset replaces placeholder to empty value


Topic: Mdb Select Form reset replaces placeholder to empty value

kausar.kapadia pro asked 6 years ago

I am using latest version of MDB(6.2.5) till 6.2.3 this issue was not there. I am using mdb-select component along with reactive forms. The same form is re used after submitting  so we will reseting entire form after submit. In that scenario when ever we reset or setValue using any false value(undefined, null, '') Placeholder  value is disappeared.  
<div style="width: 200px; padding: 20px;">

MdbSelect: <mdb-select

[options]="testData"

name="testSelect"

placeholder="Choose a type"

customClass="filled-in"

formControlName="testSelect"></mdb-select>

</div>



toggleSelectVals() {

this.toggle=!this.toggle;

this.testData= (this.toggle?this.tData1:this.tData2);

if (this.toggle) {

this.tForm.get('testSelect').setValue(1);

// this.tForm.get('nSelect').setValue(2);

} else {

this.tForm.get('testSelect').reset();



}

}
this is the HTML and Typescript code im using to reset(sample code).
When we change value of selectbox (select a value) from HTML and then reset the value Then place holder disappears.

kausar.kapadia pro answered 6 years ago

I have found the root cause for this but i will not be able to fix it from our end.It would be best if you guys provide a fix for this. When the value is once selected hasSelected value is being set to true and when the value is empty or null or undefined hasSelected value is not being reset again.

reachfrq pro commented 6 years ago

Working fine. Thank you. How to deploy this server.js in aws ec2 instance. Could you please provide any link?

Arkadiusz Idzikowski staff answered 6 years ago

Dear kausar.kapadia, We will take a closer look at this problem. Thank you for all the information. Regards, Arek

Subrata Paul pro answered 6 years ago

Same Problem with me. Please give me any solution for this.. Regards, Subrata Paul
similar issue, image does not display  
<img class="d-flex mr-3" src="profile_picture.jpg" alt="Generic placeholder image">

Arkadiusz Idzikowski staff answered 6 years ago

The problem with placeholder will be fixed in next version of MDB Angular. @Helmar Bachle This topic is about bug in mdb-select. What is the problem with image display?
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
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.3
  • Device: Windows, Mac Laptop and desktop
  • Browser: Chrome, firefox
  • OS: Windows, MacOS
  • Provided sample code: No
  • Provided link: No
Tags