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

Select field is not rendered properly if used with snapappointments/bootstrap-select #285

Open
bkiziuk opened this issue Mar 27, 2023 · 0 comments
Labels

Comments

@bkiziuk
Copy link

bkiziuk commented Mar 27, 2023

I am using bootstrap-select:

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.14.0-beta3/js/bootstrap-select.min.js"></script>

with data-live-search feature:

{{ render_field(form.user_id, form_type='horizontal', id='userid', **{'data-live-search': 'true'}) }}

<script>
        $(document).ready(function() {
            $('#userid').selectpicker();
        });
</script>

The result of rendering is:
image

which does not look good as the working bootstrap-select is embedded in a static and not responsive select.

The generated HTML is:

<div class="dropdown bootstrap-select form-select dropup">
     <select class="form-select" data-live-search="true" id="userid" name="user_id" required="" tabindex="null">
          <option value="1">Admin Admin (admin)</option>
     </select>
     <button type="button" tabindex="-1" class="btn dropdown-toggle btn-light" data-bs-toggle="dropdown" role="combobox" aria-owns="bs-select-1" aria-haspopup="listbox" aria-expanded="false" title="Admin Admin (admin)" data-id="userid">
          <div class="filter-option">
               <div class="filter-option-inner">
                    <div class="filter-option-inner-inner">Admin Admin</div>
               </div> 
          </div>
     </button>
[...]
</div>
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

2 participants