How to prevent boot bootstraps from falling out if it has form elements

http://plnkr.co/edit/rO1cev9Pw7TNbeGLioVk?p=preview

How to prevent the drop-down list from closing If I want to have several checkboxes and check or lower the mark more than once?

+7
javascript html angularjs css twitter-bootstrap
source share
2 answers

Since dropdownToggle monitors click events in order to close the drop-down menu, you need to stop distributing click events on checkbox items. This can be done as follows:

 <input type="checkbox" ng-click="$event.stopPropagation()"> 

And the work plan: http://plnkr.co/edit/AcbhOkKr2rGrPeoge26H?p=preview

+16
source share

I had a similar problem with bootstraps dropdown , and I needed a built-in (angular) multiple-selection implementation (basically, I would like to replace the selected one, since it depends on jquery). Therefore, I wrote it myself.

Here is the plunker showing the dropdown menu:

http://plnkr.co/edit/lxewJUN8li9YQj9h1cIz?p=preview

It has Select All support if you need something similar.

Hope this helps.

NOTE: For some reason, it only works with an unstable branch.

0
source share

All Articles