-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Dropdown directives conflict with bootstrap's JS #2156
Comments
@Durz , right now there isn't any compatibility with the Bootstrap's Javascript so including Boostrap's JS could have undesirable consequences. |
I just ran into the same problem. I think it is sufficient to mention it in the docs. and thanks to pointing me to the solution @Durz ;) scenario: |
On a second thought, maybe we should prefer to prevent the conflict by overwriting the data-toggle attribute. |
@chrisirhc Thanks for that bit of info. I don't have a particular feature that I'm missing. I was updating UI-Bootstrap from 0.10.0 to 0.11.0 for an existing project that has had code written before UI-Bootstrap was brought in (hence the use of bootstrap.js), and found my dropdowns requiring several clicks to open. It wasn't immediately obvious that UI-Bootstrap was conflicting with Bootstrap's JS as I don't think the docs mention that you shouldn't use the two together. |
@bekos @chrisirhc I wonder if we shouldn't drop |
Agree to drop the |
OK, let's drop |
Fixes angular-ui#2156 BREAKING CHANGES: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <btutton class="dropdown-toggle" ...> ``` After: ```html <btutton class="dropdown-toggle" dropdown-toggle ...> ```
Fixes angular-ui#2156 BREAKING CHANGES: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <btutton class="dropdown-toggle" ...> ``` After: ```html <btutton class="dropdown-toggle" dropdown-toggle ...> ```
Hi guys! You talked about removing the |
I spent hours discovering this issue myself, finally finding an explanation here so making a note. It would be nice if bootstrap.js and angular-bootstrap.js were compatible. I tried the latest version here and was not able to see resolution of the issue. |
Fixes angular-ui#2156 BREAKING CHANGES: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <btutton class="dropdown-toggle" ...> ``` After: ```html <btutton class="dropdown-toggle" dropdown-toggle ...> ``` Closes angular-ui#2170
As @inquire mentioned, I think the situation is not clear yet. @bekos create a commit on his fork, but it is not yet available anywhere in this repository. Also that commit probably miss a Breaking Change note somewhere in the Changelog. @Durz, could you please re-open this issue, until the commit actually get merged ? (the MIFOSX-1387 "merged" mentioned on this page actually refers to an entirely different project) |
Also I don't see how @bekos commit avoid the conflict. According to the commit message, this is the new syntax that should be used: Before: <button class="dropdown-toggle" ...> After: <button class="dropdown-toggle" dropdown-toggle ...> But as you can see the CSS class are not modified at all. So wouldn't the original Bootstrap JavaScript still behave exactly as originally described by @inquire and enter in conflict with ui-boostrap directives ? |
reopened as requested. From what I can see in the commit diff, the |
@Durz I believe the default value for restrict is 'A'. However, this changed recently in 1.3, but we haven't gotten around to 1.3 support yet. With regards to @PowerKiKi 's comment, now dropdown classes aren't linked as directives via ui-bootstrap. As mentioned in the http://getbootstrap.com/javascript/#dropdowns, the
|
Thank you for those explanations. Not being familiar with original Bootstrap JavaScript I was under the impression that initialization was automated and we could not have any control on that. Your suggestion totally makes sense, thanks. |
Fixes angular-ui#2156 Closes angular-ui#2170 BREAKING CHANGE: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <button class="dropdown-toggle" ...> ``` After: ```html <button class="dropdown-toggle" dropdown-toggle ...> ```
Thanks @chrisirhc , it works |
Fixes angular-ui#2156 BREAKING CHANGES: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <btutton class="dropdown-toggle" ...> ``` After: ```html <btutton class="dropdown-toggle" dropdown-toggle ...> ``` Closes angular-ui#2170
Fixes angular-ui#2156 Closes angular-ui#2170 BREAKING CHANGE: Both `dropdown` and `dropdown-toggle` are only attribute directives Before: ```html <button class="dropdown-toggle" ...> ``` After: ```html <button class="dropdown-toggle" dropdown-toggle ...> ```
Is there anywhere where the breaking changes are documented between version? This one just tripped me up, and wondering if there are any more I don't know about. |
@michaeldjeffrey Not that I'm aware of - you can look at all of the issues with a angular1.3 label to get a rough idea. |
thanks @chrisirhc it worked for me in laravel and react js |
The dropdown directives have a restrict value of
CA
. This means that if you also have bootstrap.js referenced as a script file, the directives conflict with Bootstrap's JavaScript hooks into thedropdown
anddropdown-toggle
classes.See this plunker. Notice that it takes two clicks to open a non-directive dropdown.
http://plnkr.co/edit/AYHYLesd4025dUdfLT7i?p=preview
The text was updated successfully, but these errors were encountered: