Search code examples
jquerybootstrap-typeaheadtypeahead.js

Prevent the closure of typeahed.js


Is it possible to prevent the closure of the typeahed div (that appear after typing below the input), when I select an element?


Solution

  • Well this is ugly but does the job. Note it may break in future versions of typeahead, of course:

    http://jsfiddle.net/5fnX7/

    Basically you override DropdownView's close() method:

    $(".tt").data("ttView").dropdownView.close = function() { };