mdb-select 2 multiselect pop-up close


Topic: mdb-select 2 multiselect pop-up close

Wojciech Marciniak asked 4 years ago

*Expected behavior*

There is a method to close the select's pop-up programmatically (just like we hide the modals). Single select closes at making a choice and that's correct. But in case of multi-select there is no clear advice for the end-user how to end up with selecting options.

*Actual behavior*

The only way to close the pop-up is to click somewhere outside the pop-up which may lead to unwanted triggering some other components on the page and is definitely neither intuitive nor user-friendly.

Resources (screenshots, code snippets etc.)


Arkadiusz Idzikowski staff answered 4 years ago

The close method is already available, we need to update the documentation page.

Here is an example:

HTML:

<div class="md-form">
  <mdb-select-2 #select placeholder="Choose your option" label="Example label">
    <mdb-select-option *ngFor="let option of options" [value]="option.value">{{ option.label }}</mdb-select-option>
  </mdb-select-2>
</div>

TS:

@ViewChild('select') select: MdbSelectComponent;

closeSelect() {
  this.select.close();
}

Wojciech Marciniak commented 4 years ago

So, please update to avoid further confusing the dev crowd. Thank you.


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: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 9.3.1
  • Device: any
  • Browser: any
  • OS: any
  • Provided sample code: No
  • Provided link: No