Bootsrap 5 Dropdown stops working after update
See original GitHub issueGuys, I have the following problem:
I created a unicorn component and it is basically a card with some visualization options, for that it uses a dropdown, following the structure:
{% load i18n %}
<div>
<div class="card">
<div class="card-body p-3 position-relative">
<div class="row">
<div class="col-8 text-start">
<p class="text-sm mb-1 text-capitalize font-weight-bold">{% translate 'Credits' %}</p>
<h5 class="font-weight-bolder mb-0">
{{ balance }}
</h5>
<span class="text-sm text-end font-weight-bolder mt-auto mb-0
{% if is_good != None %}{% if is_good %}text-success{% else %}text-danger{% endif %}{% endif %}">
{{ periodic_balance }}%
</span>
</div>
<div class="col-4">
<div class="dropdown text-end">
<a href="javascript:;" class="cursor-pointer text-secondary" id="{{ element_id }}"
data-bs-toggle="dropdown" data-toggle="dropdown" aria-expanded="false">
<span class="text-xs text-secondary">{{ period_start|date:"d M" }} - {{ period_end|date:"d M" }}</span>
</a>
<ul class="dropdown-menu dropdown-menu-end px-2 py-3"
aria-labelledby="{{ element_id }}">
<li>
<button class="dropdown-item border-radius-md" unicorn:click="click_today">
{% translate 'Hoje' %}
</button>
</li>
<li>
<button class="dropdown-item border-radius-md" unicorn:click="click_week">
{% translate 'Últimos 7 dias' %}
</button>
</li>
<li>
<button class="dropdown-item border-radius-md" unicorn:click="click_month">
{% translate 'Últimos 30 dias' %}
</button>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
Call:
{% unicorn 'credits' user=user.pk lang=LANGUAGE_CODE id="dropdownCredits" %}
Is there any way to re-enable the dropdown or even avoid this problem? I tried the bootsrap JS calls, but with no success.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Bootstrap dropdown not working - Stack Overflow
I had updated my Gruntfile.js which changes some of the paths in the jsFileList ...Updating the paths and running the appropriate Grunt tasks...
Read more >[Solved]-Bootstrap dropdown not working - Studytonight
The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute...
Read more >Bootstrap 5 dropdown not working (SOLVED) - YouTube
Bootstrap 5 dropdown not working (SOLVED) ; Professional CSS Course: https://bytegrad.com/professional-css... ; Professional JavaScript ...
Read more >Dropdowns · Bootstrap v5.2
Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript ...
Read more >Drop-downs not working after updating to 5.5.2 - Drupal
After updating to 5.5.2, my drop-down menus stopped working. ... it navigates me to that link/page instead of revealing the drop-down menu.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry I didn’t answer, I haven’t tested it yet but it looks like it’s perfect for this situation, I’ll close the issue in this case.
Thank you very much!!
v0.34.0 now includes lifecycle events which might be helpful: https://www.django-unicorn.com/docs/templates/#lifecycle-events.