Material Select blanks in option ignored and pushes to first


Topic: Material Select blanks in option ignored and pushes to first disabled option

cdenby pro asked 6 months ago

Expected behavior If I have a mdb-select that has a selected blank whitespace option, but also has any number of disabled options, it should show as blank.

Actual behavior In this case, the actual display picks the first disabled option to show in the input box instead of the blank.

Resources (screenshots, code snippets etc.)

In this example, the selected value appears as "3"!

<select class="mdb-select ddTemplate initialized" 
    data-visible-options="-1" 
    onchange="DoSomething(this);">
    <option value="" selected="selected">&nbsp;</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3" disabled="disabled">3</option>
    <option value="4" disabled="disabled">4</option>
    <option value="5" disabled="disabled">5</option>
</select>

Code Snippet:Snippet of the issue with additional behaviours


Tomek Makowski staff commented 6 months ago

Hi

This is an issue with our package and we add this problem to our "To do" list

Regards and thanks for reporting


Please insert min. 20 characters.