S. M. Momin
S. M. Momin

Reputation: 449

On mobile select2 search hide when mobile keypad open

On Browser site work well.. but,when i open it on mobile problem i face like bellow image. enter image description here

after scroll page down i see search box like this.. enter image description here

Any one help me solved this problem code is here.

<td colspan="2">
<select name="sel_specialities" id="sel_specialities"  data-placeholder="--<?php echo $this->lang->line('select'); ?>--" class="select" >
    <option value=""></option>
    <?php
    foreach ($specList as $spec) {
        ?>
        <option value="<?php echo $spec['SPEC_ID']; ?>" <?php echo $this->session->userdata('sel_specialities') == $spec['SPEC_ID'] ? 'selected="selected"' : ''; ?> ><?php echo $spec['SPEC_NAME']; ?></option>
        <?php
    }
    ?>
</select>

Script

$(function () {

$(".select").select2();

});

Upvotes: 2

Views: 1483

Answers (1)

Razib Al Mamun
Razib Al Mamun

Reputation: 2711

Add in your css

body .select2-container.select2-container--default.select2-container--open {
    top: 305px!important;
    left: 22px!important;
}
.select2.select2-container.select2-container--default.select2-container--below.select2-container--open {
    top: auto!important;
}

Upvotes: 1

Related Questions