Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boostrap dropdown events not working with bootstrap-ui

According to http://getbootstrap.com/javascript/#dropdowns events (e.g., show.bs.dropdown, hide.bs.dropdown) are thrown when a drowdown is opened/closed. This works until module bootstrap-ui is active. I created a plunkr that shows the issue http://plnkr.co/edit/luYpweQZx22IkWHeMKhM. The events are thrown when the dependency to ui.boostrap is removed, that is

var app = angular.module('myapp', ['ui.bootstrap']);

is replaced with

var app = angular.module('myapp', []);

Versions are: Bootstrap 3.0.3, Angular 1.2.4 (also tested with 1.2.13), Angular UI Bootstrap 0.10.0, JQuery 2.0.3

Seems to be a bug in bootstrap-ui, any ideas for a workaround?

like image 602
cnmuc Avatar asked Mar 06 '14 00:03

cnmuc


People also ask

Why dropdown menu is not working in Bootstrap?

Solution : The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute so the dropdown is not working. So add data-bs-toggle="dropdown" to toggle the dropdown.

How do I add a dropdown list in Bootstrap?

To open the dropdown menu, use a button or a link with a class of . dropdown-toggle and the data-toggle="dropdown" attribute. Add the . dropdown-menu class to a <div> element to actually build the dropdown menu.

How do I keep my Bootstrap dropdown open?

Just wrap the contents of the menu in a form tag. That's it. So, instead of ul. dropdown-menu , use form.

How do you toggle a dropdown in Bootstrap?

Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They're made interactive with the included Bootstrap dropdown JavaScript plugin. They're toggled by clicking, not by hovering; this is an intentional design decision.


1 Answers

Bootstrap UI must have over ridden the Bootstrap default js events

I wrote some code to do it .. it might atleast give you some idea

http://plnkr.co/QYKcPEepOrqdyXzfrekH

like image 190
Mr.MAD Avatar answered Oct 28 '22 15:10

Mr.MAD