Selected option from Multiselect not properly selected


Topic: Selected option from Multiselect not properly selected

support@sync.my pro asked 6 years ago

I have issue to show selected option with multiselect form, the mdb layout not showing the correct selected option as showing in standard html as I inspected.

Here is the sample code: 

<select class="mdb-select md-form" multiple>

<optgroup label="team 1">

<option value="1">Option 1</option>

<option value="2">Option 2</option>

</optgroup>

<optgroup label="team 2">

<option selected value="3">Option 3</option>

<option value="4">Option 4</option>

</optgroup>

 

<optgroup label="team 3">

<option value="5">Option 5</option>

<option selected value="6">Option 6</option>

</optgroup>

 

<optgroup label="team 4">

<option selected value="7">Option 7</option>

<option value="8">Option 8</option>

</optgroup>

</select>

<button class="btn-save btn btn-primary btn-sm">Save</button>

Here the screenshot for my inspection and its view generated.


Sebastian Kaczmarek staff pro premium answered 6 years ago

This is clearly a bug. We'll fix that


Hello,

I do have the same issue.

Is a fix coming soon, or should i find another solution (This component was pretty useful on my project)?

 

Thanks by advance


Sebastian Kaczmarek staff pro premium commented 6 years ago

Hard to say but I can tell you that it won't appear before the end of 2018. Probably right at the beginning of 2019. 


Mighty Midget pro commented 6 years ago

Has the fix been released yet? As this is happening on my project too.


Piotr Glejzer staff answered 6 years ago

I already fixed that. If someone wants to use a fix for that so you have to do for your own for now. It will be fixed globally in the next release.
At function renderMaterialSelect() you have to find

const = $(element).index();

and change it to

 const = element.index; 

It should be work.


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 jQuery
  • MDB Version: 4.5.10
  • Device: Macbook Pro 2013
  • Browser: Chrome
  • OS: MacOS Sierra
  • Provided sample code: Yes
  • Provided link: No