Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDropdown needs two clicks to open #2294
Comments
|
+1 Took a while to find out the culprit! |
|
I believe you're including the bootstrap.min.js / bootstrap.js on top of ui-bootstrap.js . That's not compatible with the Angular UI Bootstrap JavaScript as the Bootstrap's code would interfere with UI Bootstrap's code. Could you create a Plunker that demonstrates this? |
|
I created a Plunker http://plnkr.co/edit/osRsf6CTiQTFG7LpDt09?p=preview At this page I do not use "dropdown" directive anywhere (In my opinion - as attribute) I think it's a bug, because I not set "dropdown" directive attribute explicitly. |
|
I observed the same issue when I upgraded from 0.10 to 0.11. When I change nothing else and revert back to 0.10, it works fine. I don't include bootsrap.js, but I use a bootswatch theme (Yeti) that loads bootstrap. Here is what I see in the final (produced by Rails) HTML:
|
|
Сool! Thank you! 2014-06-20 20:00 GMT+06:00 istibekesi notifications@github.com:
|
|
I'm having the same issue If I remove the UI-bootstrap script then the dropdown opens fine. If I include the UI-bootstrap script then the dropdown doesn't open on the first click. I've tried re-ordering the script blocks (mine are at the bottom of the page) and it doesn't make any difference if UI-bootstrap is before or after bootstrap.js.... |
|
Sorry, I deleted my previous misleading post, because re-ordering makes no sense... In the plunk it seemed to be working, but the only reason why dropdown was working is that the whole bootstrap-ui js was broken. However, change the version back to 0.10.0 was solved the dropdown issue in the navbar, but breaks other things, for example alert. I'm getting to be very confused: |
|
You can temporarily use version 0.11.0 but without including ui.bootstrap.dropdown dependency. |
|
@chrisirhc regarding
Does it mean Angular UI Bootstrap includes all the features of bootstrap.js or does it mean we have to use the individual bootstrap.js parts that don't overlap with Angular UI Bootstrap? |
|
You have to remove the data-toggle attribute. dropdown-toggle directive already takes care of toggling. I had also some issues with <a href="#"> and resolved them by using <a href="javascript:void(0);"> (dropdown didn't always close) |
|
@seyyedi Thanks a lot! |
|
Thank you, I can confirm, that removing "data-toggle='dropdown'" works. |
|
If you add data-disabled="true" on the element, you disable the angular-ui part and can use plain bootstrap. We have a website where jquery(legacy) and Angular are mixed together. |
|
@Snede answer works for me ;) Thank you |
|
FWIW, with @Snede's solution make sure the attribute is actually set to |
|
same issue here, all worked fine when removed data-toggle. thx =D |
|
for now the workaround works, but |
|
+1, but workaround works |
|
Glad I found this bug. Took a bit of Google-fu to get the keywords right :) FWIW I removed my own reference to bootstrap.min.js - simply including angular-ui-bootstrap's javascript is sufficient to get "raw" Bootstrap dropdowns to work. |
|
Can someone explain why it is now necessary to remove the dropdown-toggle is still listed in the docs as necessary. Will removing this end up hosing it later down the line, when we pull another upgrade? |
|
This library currently doesn't support AngularJS 1.3. We're working towards that. Please report new issues that you find with your upgrade if they haven't already been reported. |
|
+1. Removing data-toggle="dropdown" fixes this issue |
|
@chrisirhc thanks for the feedback. So, pulling I believe the latest version released in the bower repo is 0.11.2 However, that version has several other things broken with respect to Angular 1.3.2 (e.g. tooltip broken). So, I pulled from master and built my own today -- i.e. tracking Any idea? Update Edit: actually, this markup fails: <div dropdown class='btn-group'>
<a type='button' role='button' class='btn btn-info dropdown-toggle'>Click</a>
<ul class='dropdown-menu' role='menu'>
...But change the directive attribute <div class='btn-group dropdown'>
... |
|
Upgrading to 0.12 solved it for me, even keeping |
|
@Snede 's answer works for me. |
|
Trying to upgrade from 0.10.0 to 0.11 or 0.12 whilst using Angular 1.3. Haven't been able to get 0.12 to work at all. Since 0.11.1 the parent element of |
|
Ahh I didn't properly read the breaking changes in the CHANGELOG for dropdowns in 0.12.x. only |
Before category dropdown did not auto closed itself after a category was selected. This was most likely due to mixed use of jquery and angular-ui. This commit sets correct data-toggle attribute and data-disabled, that only enables plain bootstrap usage. Also sets more "aria-labelledby" to point to toggle button, as most examples suggest. Reference: angular-ui/bootstrap#2294 Closes-Bug: #1478945 Change-Id: Ic1da66ac911677aeac7e7a7a6747b60d01b6e05e
|
@theoziran, please do not only add |
… on dropdowns (more info: angular-ui/bootstrap#2294)
* master: (29 commits) Annotate controller dependencies in modal call🔥 responders gem remove unused instance variable @gender_counts (related to bb9a2f0) fix path generation in grouped_index template move logic outside the view add Taggable tests, filter tags with 'ignore case', tokenSeparators only by comma posts (offers/inquiries) tests: check if tags are updating properly improve TagsController specs and fix a warning✂️ a couple of unused views routes: little clean up Tags code clean up move tags related js outside the template✂️ Tags Manager library New Tagging system using Select2 [WIP] continuation of 3a20539 Angular annotations in array mode =>✂️ ngannotate-rails Drop a couple of deprecated partials [workaround] remove "data-toggle" => "dropdown" to avoid double click on dropdowns (more info: angular-ui/bootstrap#2294) use Rails.application instead of Timeoverflow::Application Update to latest rspec-rails (3.4) ...
|
Although it solves the problem of not having to double-click, now the dropdown doesn't close when i select an element. |
…et it to open. angular-ui/bootstrap#2294
|
Confirmed! Adding 'data-disabled="true"' makes menu open on the first click, but in doesn't close |
|
@chrisirhc thanks it works for me. |
When upgrading from 0.10 to 0.11, drop-down menus started requiring two clicks in order to open (at least for nav-bar drop-down menus.) Removing
data-toggle="dropdown"from the primary toggle element fixes the problem, but this is no longer the bootstrap-suggested syntax.I suggest making a clear note of this in the documentation or make the dropdown directive compatible with the standard bootstrap syntax (like it was in 0.10.)