Material Select Empty option is too small


Topic: Material Select "Empty option" is too small

Custer pro premium asked 2 months ago

Expected behavior The "Empty Option" choice should be as big as the options that are not empty.

Actual behavior The "Empty Option" choice is too small. Hardly to find for an user.

Resources (screenshots, code snippets etc.) enter image description here


Krzysztof Wilk staff answered 2 months ago

Hello!

Maybe try to set static height of each dropdown element in CSS? If you tried to and it gave no result, can you put your code into snippet? It'll be helpful


Custer pro premium answered 2 months ago

Hi, sorry I've no idea how to do this. I tried some styling directly to the option-tag, without any succes. I tried padding, height and font-size.

Here's my code:

<div class="row">
                <div class="col-12">
                    <select class="mdb-select md-form md-selected colorful-select dropdown-primary" searchable="Suche" name="einsatzleiter" required>
                    <option></option>
                    <?php 
                        getDropdownAndCheck("tbl_Mitarbeiter", "Name", $einsatzleiter);
                    ?>
                    </select>
                    <label class="mdb-main-label">Einsatzleiter *</label>
                </div>
            </div>

Krzysztof Wilk staff answered 2 months ago

Just put .filtrable { height: 40px !important; } to your CSS, you can change number of height pixels if you want to make your option look taller or smaller.


Custer pro premium answered 2 months ago

Just put .filtrable { height: 40px !important; } to your CSS, you can change number of height pixels if you want to make your option look taller or smaller.

This answer worked for me. I used 35px and now the empty option looks like the filled options. Perfect!

Thank you very much :)


Please insert min. 20 characters.