Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectpicker dropdown is overlapping the select input when it has a parent with overflow auto #2589

Open
mrtawil opened this issue Mar 20, 2021 · 2 comments
Labels

Comments

@mrtawil
Copy link

mrtawil commented Mar 20, 2021

Hello guys,

Environment:

  • Selectpicker: 1.13.18
  • Bootstrap: 4.5.0
  • Popper Js: 1.16.1

Reproduction:
Place selectpicker inside a table row and wrap the table with class table-responsive.

Code:

<div class="form-group">
  <label class="font-weight-bold text-capitalize" for="units">Units</label>
  <div class="table-responsive">
    <table class="table table-bordered mb-0" id="units">
      <thead>
        <tr>
          <th class="text-capitalize" width="100%">Unit*</th>
          <th style="width:70px;"><a href="javascript:;" id="add_row" class="d-flex justify-content-center align-items-center" v-on:click="_addDefaultUnitSelected()"><i class="fa fa-plus-square fa-2x"></i></a></th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(unitSelected, index) in unitsSelected">
          <td>
            <select name="unit_id[]" v-model="unitSelected.unit_id" data-label="unit_id" class="form-control selectpicker" data-size="7" data-live-search="true" data-container="body">
              <option value="">Select</option>
              <option :value="unit.id" :class="[unitSelectedIds.includes(unit.id) && unitSelected.unit_id != unit.id ? 'd-none' : '']" v-for="unit in units">
                <template>@{{unit.name}}</template>
              </option>
            </select>
          </td>
          <td style="vertical-align: middle;">
            <a href="javascript:;" class="d-flex justify-content-center align-items-center" v-on:click="_removeUnitSelected(index)" data-label="button-delete"><i class="fa fa-minus-square fa-2x"></i></a>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</div>

Result:
image
image

Desired:
image

Claim:
If I remove class table-responsive, the dropdown will be positioned right but I will breakdown the layout on mobile screen.

@mrtawil mrtawil added the bug label Mar 20, 2021
@jadamec
Copy link

jadamec commented Nov 20, 2022

Any changes on this? Nearly 2 years old...

@NicolasCARPi
Copy link
Collaborator

@jadamec please read this: #2228 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants