Using Bootstrap Typeahead and Twitter Typeahead Together

It would seem that Twitter Typeahead (TTA) and Bootstrap Typeahead (BTA) both occupy the identifier: $.typeahead .

It seems that TTA means being compatible with Bootstrap, as the documentation indicates that just add TTA after BTA.

How can I use BTA and TTA at the same time if both of them are called using $.typeahead ? Are there other overlaps to consider?

Since the BTA is not yet a proper subset of the TTA functionality (for example, BTA can display drop-down offers even without input by setting minLength to 0, TTA does not seem to have this), it would seem that this is desirable in certain cases.

This question reflects the issue sent to the TTA tags, as the TTA documentation indicates that it is Bootstrap-compatible.

+4
source share
1 answer

How Jake Harding put it :

Using both typeahead.js and Bootstrap typeahead is not recommended. Having said that, if you want to do this, all Bootstrap plugins have noConflict, which will allow you to do something like:

$.fn.bootstrapTypeahead = $.fn.typeahead.noConflict();

+5
source

Source: https://habr.com/ru/post/1469520/


All Articles