Brian M. Hunt
Brian M. Hunt

Reputation: 83808

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 is mean to be Bootstrap-compatible, as the documentation indicates that one simply add TTA after BTA.

How might one concurrently use both BTA and TTA if they both are called with $.typeahead? Are there other overlaps one must consider?

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

This question mirrors an issue posted to the TTA issues, as TTA documentation indicates that it is Bootstrap-compatible.

Upvotes: 4

Views: 925

Answers (1)

Brian M. Hunt
Brian M. Hunt

Reputation: 83808

As Jake Harding put it:

It's not recommended to use both typeahead.js and Bootstrap's typeahead plugin. Having said that, if you wanted to do it, all Bootstrap plugins have noConflict available that'll allow you to do something like:

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

Upvotes: 5

Related Questions