Skip to content
thednp edited this page Dec 30, 2019 · 21 revisions

Does this library work as a drop-in replacement for the original jQuery plugins?

If your markup is valid and provides the expected element attributes, the answer is YES, however if your application makes use of public methods, or expects the event handlers to behave exactly the same as the original, the answer is NO as explained later on this page. You will need to make proper updates to your application scripting in order to connect or access the library's generated objects.

What's different with the jQuery plugins?

Some component public methods may have different names, but stay cool, for each component these details are fully explained. The Popover and Tooltip components are initialized right away when target elements use proper DATA API, while the original plugins require a manual initialization.

An important difference however is that the jQuery version will bind events globally and delegate the handlers to elements allowing the plugins to work with later added elements, more details here.

Does it work with Webpack?

The answer is YES. Check out this repository.

Does it work with legacy browsers (like IE8)?

The answer is YES, Bootstrap Native 3 does, however Bootstrap 4 requires IE10+ so please make sure to check the browser support wiki page for an in depth guide on how to enable legacy browsers to use the library.

Does it use DATA API?

The answer is YES, but it's different from the original version. The original version relies on jQuery's data() method to store functionality at the node level, while we only use the data-toggle="dropdown" or data-interval="5000" as a means of elements query or setting component options. The jQuery data() might be the real answer to the this question.

Does it support nesting?

The short answer is NO, except the Dropdown component. The library does not support this kind of functionality especially for complex components like Carousel. The Tab or Collapse components could work but it wasn't tested or developed with nesting in mind. For components like Tooltip and Popover it wouldn't make sense.

Can I use e.preventDefault() on custom events?

The answer is YES, starting with version 2.0.28. When you use e.preventDefault() for an event like hide.bs.modal, the event target will not fade out, but will remain visible and ready for further interactions. However using e.preventDefault() on events like hidden.bs.modal or slid.bs.carousel will produce no effect, since the respective components completed the execution, making it hard to argue the fact that preventing certain tasks could break the application completely.

Can I show multiple modal elements simultaneously?

The answer is NO, however you can trigger show() for other modal elements from inside modals, closing any visible modal automatically, just as shown in the demos.

Does the Carousel support swipe?

The answer is YES, starting with version 2.0.26.

Does the library support passive events?

The answer is YES, also starting with version 2.0.26.

Does it work with CustomElements?

The answer is YES, but not out of the box, so please check this comment to learn more about a user's experiment.

Does it work with later added elements?

The answer is NO in most cases. As discussed in this topic, and several other instances (#62, #60), the event listeners used by the components are not bound to the document and delegated to specific elements like jQuery plugins do, rather we took a more performance oriented approach and decided to bind event handlers to elements themselves, for performance reasons.

When you add a new element to your page, you need to make sure you initialize it the right away:

// grab your newly added element
var myElement = document.getElementById('myElement');

// initialize with the corresponding component
var myCarousel = new Carousel(myElement,options);

More on jQuery plugins implementation here.

Does it run Crysis?

I don't know.

More FAQs coming soon..

Clone this wiki locally