tamble / jquery-ui-daterangepicker

A JQuery UI based date range picker.
MIT License
184 stars 110 forks source link

bootstrap and jquery-ui $.button() conflict fix. #88

Closed ludoza closed 6 years ago

ludoza commented 6 years ago

If you load bootstrap.js after jquery-ui.js the $.fn.button() function will point to a bootstrap method instead of a jquery-ui function.

Fix found at https://github.com/twbs/bootstrap/issues/6094#issuecomment-11148540 might want to add console.warning('bootstrap conflict with jquery-ui $.fn.button.') to the inner if block, but I like my console clean.

op16 commented 6 years ago

The conflict with bootstrap affects many other jQueryUI widgets. Each one fixing this conflict on its own is not a way to go. Any fix should go in the calling code, not in the widgets.

See also this comment: https://github.com/tamble/jquery-ui-daterangepicker/issues/8#issuecomment-122015875

ludoza commented 6 years ago

understandable and sane. What about a if check before the first use of button to make sure if it is a jui fn and if not throw a exception?

But current behavior might be preferential because the button still works, it is just unstyled, and look broken, due to css/lib mismatch.