Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

397
Views
Select2 search input not working on bootstrap5

I cannot click on the search input dropdown. First of all, I already googled and this is a common problem for select2 with bootstrap3 or bootstrap4, however for bootstrap 5 its a little bit different (I tried remove z-index on bootstrap 4 and its working), I already tried solutions like z-index, $.fn.modal.Constructor.prototype.enforceFocus = function() {};, $('#mySelect2').select2({ dropdownParent: $('#myModal') });, and several css but still wont work.

Maybe im missing something im not sure, its been like 4 days, hope u guys can help me.

here jsFiddle : jsfiddle

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Really not sure why, but dropdownParent will fix it.

$('.select2').each(function () {
    $(this).select2({
        theme: 'bootstrap-5',
        dropdownParent: $(this).parent(),
    });
});
about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!