Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown not working when using the picker with bootstrap ui #3

Open
pihomeserver opened this issue Jan 5, 2015 · 3 comments
Open

Comments

@pihomeserver
Copy link

Hello,

The dropdown is not working when including Bootstrap and Angular UI. The directive dropdown has to be added to the span tag in the template generated by iconpicker and it solved the issue

Explanations can be found here : angular-ui/bootstrap#2156

Using Angular 1.2.28, bootstrap 3.2.0 and angular-bootstrap 0.11.2

Regards

@pihomeserver
Copy link
Author

Hello
Just add dropdown in the span tag

Le 16 janv. 2015 à 08:43, Daniel Rasinski [email protected] a écrit :

Can u post ur template?

   $templateCache.put("templates/iconpicker.html",
   "<span class='btn-group ui-iconpicker' ng-class='{ disabled: disabled }'>"+
         "<button type='button' data-toggle='dropdown' class='btn btn-default btn-xs'><i class='{{ iconClass }}'></i><span class='fa fa-caret-down'></span>" +
         "</button>" +
         "<ul c

@risfeng
Copy link

risfeng commented May 5, 2016

Thanks, successful solution.
Only need to add data-toggle='dropdown'to button.

return $templateCache.put("templates/iconpicker.html", "<span class=\"btn-group ui-iconpicker\" ng-class=\"{ disabled: disabled }\">\n <button type=\"button\" data-toggle='dropdown' class='btn btn-default btn-xs'><i class=\"{{ iconClass }}\"></i><span class='fa fa-caret-down'></span>\n </button>\n <ul class=\"dropdown-menu\" role=\"menu\">\n <li ng-repeat=\"class in availableIconClasses\">\n <button class=\"btn btn-default\" type=\"button\" ng-click=\"$parent.iconClass = class\"><span class=\"{{ class }}\"></span></button>\n </li>\n </ul>\n <input name=\"{{ name }}\" type=\"hidden\" value=\"{{ iconClass }}\" ng-if=\"name\" />\n</span>");

@tekbuds-manisha
Copy link

tekbuds-manisha commented Jan 13, 2017

The above fix works for first click, but fails at times. This is the correct fix (correct usage of uib-dropdown):

$templateCache.put("templates/iconpicker.html", "<span class="btn-group ui-iconpicker" uib-dropdown >\n <button type="button" uib-dropdown-toggle ng-disabled='disabled' class='btn btn-default btn-md'><i class="{{ iconClass }}">\n \n <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">\n <li ng-repeat="class in availableIconClasses">\n <button class="btn btn-default" type="button" ng-click="$parent.iconClass = class"><span class="{{ class }}">\n \n \n <input name="{{ name }}" type="hidden" value="{{ iconClass }}" ng-if="name" />\n");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants