-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Conflict between bootstrap-button.js (v2.2.1) and jQuery UI (1.9.2) #6094
Comments
Is this a namespace issue? |
Both Bootstrap and jQuery-UI defines $.fn.button, so one of them would be overridden. |
I agree that it aught to be changed on the Bootstrap side, if possible. I think jQuery UI defined it "first" but I could be wrong ;) |
That's silly. but! i went ahead and added So if you are worried about namespace collisions you can call:
this will be live in 2.2.2 |
if i use this code to avoid conflict, another issue occour, something like TypeError: Property 'button' of object [object Object] is not a function . var btn = $.fn.button.noConflict() // reverts $.fn.button to jqueryui btn $.fn.btn = btn // assigns bootstrap button functionality to $.fn.btn code is here. |
@fat please help! |
i have "Uncaught TypeError: Object function ( options ) {..} has no method 'noConflict' " when i call |
Choose bootstrap or jquery UI.
Using both is asking for a lot of problems and extra code. |
|
noConflict only works if bootstrap.js is loaded after jqueryui.js. If bootstrap is loaded first, then the jquery button overrides the function and the noConflict is lost (noConflict is not part of the jquery button function). I am using 2.2.2. |
Try this: if($.fn.button.noConflict) { |
Is this an issue with bootstrap 3? |
just ran into this conflict - why is this still an issue? should have been changed in bootstrap long ago. |
@andyl: It's being worked on; see #11966. But also: http://getbootstrap.com/javascript/ :
|
With respect and gratitude for Bootstrap, let me ask, what is there to work on? Just rename the function to something other than a name that has not already been chosen by jQuery. Of course - Bootstrap is not going to be out of the box compatible with every JS library under the sun. But incompatible with jQuery UI???? How about prefixing the function names with "bootstrap_*"? Wouldn't that solve the problem? |
@andyl How exactly would the alias methods not still conflict? |
@cvrebert - when the alias methods conflicted, people could use the namespaced methods as fallback. alias methods would preserve backwards compatibility for existing users. at some point maybe you deprecate the alias methods, maybe during a major upgrade. |
I am always in favor of such conflict resolution, at least for major libraries. But I must say that using 2 libraries that does at most the same thing and uses 2 different approaches is look for trouble (like I mentioned earlier in this thread). Maybe bootstrap should not support other libraries yet, it would enforce ppl to create a better organized codebase. If one may use another library, it may also change the whole design to make it standard. If such work should be done anyway, creating an alias seems pretty easy. You can build anything on top of bootstrap. The only thing I miss is the jQuery UI Widget Factory pattern, that could be used to make standard the whole plugin system and eventually avoid any kind of conflicts (bootstrap codebase would become jQuery standard, the benefits are huge). |
I wrote a small plugin simulate jQueryUI buttonset() without needing jQueryUI. It works with BS2 and BS3. May it be useful for someone else. |
@mdo / @fat : With last BootStrap 3.1.0 and jQuery UI 1.10.4, after a .noConflict() :var bootstrapButton = $.fn.button.noConflict(); $.fn.bootstrapBtn = bootstrapButton;, .button() is no more in BS namespace. But in :// BUTTON DATA-API $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { }).button() is used, so : |
A similar problem to what @manoletto described can also be found in tooltip.js/popover.js. See the discussion in #6303 and this comment. |
…flict -- Changes to make widget work correctly as filter in CGridView -- (keep it working after grid is refreshed via ajax) -- Changes to resolve button conflict between bootstrap and jQueryUI -- ( see twbs/bootstrap#6094 )
…flict -- Changes to make widget work correctly as filter in CGridView -- (keep it working after grid is refreshed via ajax) -- Changes to resolve button conflict between bootstrap and jQueryUI -- ( see twbs/bootstrap#6094 )
…flict -- Changes to make widget work correctly as filter in CGridView -- (keep it working after grid is refreshed via ajax) -- Changes to resolve button conflict between bootstrap and jQueryUI -- ( see twbs/bootstrap#6094 )
…flict + Added translation -- Changes to make widget work correctly as filter in CGridView -- (keep it working after grid is refreshed via ajax) -- Changes to resolve button conflict between bootstrap and jQueryUI -- ( see twbs/bootstrap#6094 ) -- Added translation for option "showAllText" -- see folder "messages"
…flict + Added translation -- Changes to make widget work correctly as filter in CGridView -- (keep it working after grid is refreshed via ajax) -- Changes to resolve button conflict between bootstrap and jQueryUI -- ( see twbs/bootstrap#6094 ) -- Added translation for option "showAllText" -- see folder "messages" -- Minor changes to js script file
Hello, can any one help me it's highly appreciated.. Thanks in advance for quick response. |
@YedukondaluB Your problem doesn't sound like it's related to this issue. |
|
…/bootstrap#6094 git-svn-id: https://svn.kuali.org/repos/student/enrollment/ks-enroll/trunk@49736 0ac02d80-fb3f-11dc-a574-c57244a850eb
If bootstrap-button.js or that portion of the bootstrap.js file are included with jquery ui, the buttonset() function in jquery ui quietly fails. There is no error message, but a group of radio buttons will not be re-configured into a set of buttons.
The text was updated successfully, but these errors were encountered: