Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team

I cant seem to get right my accordion when i use bootstrap, i want to create within my accordion to have dropdownlist to it, is there anyone who can help me with this logic below?

What I have tried:

<!-- Card body -->
               <div class="accordion md-accordion" id="accordionEx" role="tablist" aria-multiselectable="true">
                   <!-- Accordion card -->
                   <div class="card">

                       <!-- Card header -->
                       <div class="card-header" role="tab" id="headingOne1">
                           <a data-toggle="collapse" data-parent="#accordionEx" href="#collapseOne1" aria-expanded="true"
                              aria-controls="collapseOne1">
                               <h5 class="mb-0">
                                   This is a Sample Module class="fas fa-angle-down rotate-icon" id="collapseOne1" data-parent="#accordionEx" data-toggle="dropdown"></a>


                                   <!--Menu-->
                                   <div class="dropdown-menu dropdown-primary">
                                       <a class="dropdown-item" href="#">^__i class="media">  Media</a>

                                   </div>
                               </div>
                           </div>
                       </div>

                   </div>
Posted
Updated 17-Sep-20 22:32pm
Comments
bbirajdar 17-Sep-20 11:08am    
Make sure you have included the css files. And first make the accordion and dropdown work on the same page as two different items. If the dropdown works, then move it inside accordion

1 solution

The problem is that the parent element has overflow: hidden; set, which causes the dropdown to be clipped.

You can override that by setting the configuration to use fixed positioning:
HTML
<a type="button" id="dropdownMenu2" data-toggle="dropdown" data-popper-config='{"positionFixed":true}' aria-haspopup="true" aria-expanded="false">
Demo[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900