Re-initialising material select does not re-connect label

MDB SupportRe-initialising material select does not re-connect label
tblfounder Pro User asked 1 year ago


I have a material_select object with an associated label and no options initially.
I dynamically set its options then re=initialize it using

This results in the select being displayed with the first of the options selected, yet the label is permanently displayed within the select area – underneath the selected option text.
Selecting another option does not result in it moving above the select control as expected.

Is there something that can reconnect the operation of the label to the re-initialised select?


1 Answers
Adrian Sawicki answered 1 year ago


If I properly understood your explanation, the only problem is the order of your declarations.
material select init -> material select destroy -> append your options -> material select init again.
About the first option it will always be selected because it’s like a placeholder/instruction for a user.

How I’ve checked it:


<div class="col-md-6">
    <select class="mdb-select"></select>
    <label>Example label</label>


$(document).ready(function() {


    $('.mdb-select').append($("<option> test1 </option>"));
    $('.mdb-select').append($("<option> test2 </option>"));



If it doesn’t help or in some way I misunderstood you, give me a bit more information of what you would like to do and I’ll try my best to help you.

mejia_09 Pro User replied 9 months ago

Hello, i have the same problem, after re-initialize material select the label is in front of select, i did what you say but still not working
here is an image with the problem

-the material select is in a modal