Keep Twitter Typeahead suggestion dropdown open
Asked Answered
O

1

1

At the moment I cannot design the typeahead template I have with Google chrome Dev tools because when ever i open it as it's stated in Twitter Docs

#Input Control Loses Focus#

deactivate typeahead
close dropdown menu
remove hint
clear suggestions from dropdown menu

I do not need this behaviour. I want the dropdown to disappear only when the user click something else on the body,

Any help really appreciated

Oral answered 22/4, 2015 at 6:46 Comment(3)
Did you get it to work?Gonzalogoo
@NullHead, I think I edited the source code file at the time, man this is an old question.. sorry not sure what exactly i didOral
Have a look at it: https://mcmap.net/q/912314/-how-do-i-create-a-suggestion-drop-down-list-like-google-39-sEmu
R
3

You can do something like this

.on('blur', function(){
  ev = $.Event("keydown");
  ev.keyCode = ev.which = 40;
  $('.typeahead').trigger(ev);
  return true;
});

Here is a DEMO (start typing t in the demo)

Here is the reference

Resiniferous answered 22/4, 2015 at 14:1 Comment(1)
.on('blur', function(){ $('#myinput .typeahead').typeahead('open'); });Touter

© 2022 - 2024 — McMap. All rights reserved.