jquery-typeahead 在选择条目时隐藏建议框 [英] jquery-typeahead hide suggestion box on choosing an entry

查看:26
本文介绍了jquery-typeahead 在选择条目时隐藏建议框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩 jquery-typeahead 工作的第一个演示示例Country v1":http://www.runningcoder.org/jquerytypeahead/demo/

I am playing with the first demo example "Country v1" of jquery-typeahead work from: http://www.runningcoder.org/jquerytypeahead/demo/

$.typeahead({
  input: '.js-typeahead-country_v1',
  minLength: 1,
  order: "desc",
  dynamic:true,
  source: {
    data: data
  },
  callback: {
    onInit: function(node) {
      console.log('Typeahead Initiated on ' + node.selector);
    }
  }
});

https://jsfiddle.net/qz7dfsku/

当我选择其中一个选项时,我试图让建议框消失.

I am trying to have the suggestion box disappear when I select one of the choice.

似乎添加 dynamic: true 会破坏它,如果我将其设置为 false 则它可以工作.

It seems adding dynamic: true breaks it, if I set it to false then it works.

知道这里会发生什么吗?

Any idea what could be going on here?

推荐答案

已在 2.10.2 中修复.

Fixed in 2.10.2.

https://github.com/running-coder/jquery-typeahead/issues/380

这是一个不需要的行为,因为在选择项目时发送了一个额外的请求 #381,将尽快修补"

"that's an unwanted behaviour because of an extra request being sent #381 when the item is selected, will patch that asap"

https://github.com/running-coder/jquery-typeahead/issues/381

这篇关于jquery-typeahead 在选择条目时隐藏建议框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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