保持Twitter Typeahead建议下拉列表处于打开状态 [英] Keep Twitter Typeahead suggestion dropdown open

查看:112
本文介绍了保持Twitter Typeahead建议下拉列表处于打开状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我无法使用Google chrome Dev工具设计预先输入模板,因为我每次打开时都必须按照Twitter文档中的说明进行操作

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,

任何帮助我们都很感激

推荐答案

您可以执行以下操作

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

这是 DEMO (在演示)

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

这是参考

这篇关于保持Twitter Typeahead建议下拉列表处于打开状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆