代码之家  ›  专栏  ›  技术社区  ›  benji

jquery typeahead在选择条目时隐藏建议框

  •  0
  • benji  · 技术社区  · 8 年前

    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/

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

    它似乎添加了动态:true会破坏它,如果我将其设置为false,那么它就会工作。

    知道这里发生了什么吗?

    1 回复  |  直到 8 年前
        1
  •  0
  •   benji    8 年前

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

    “这是一种不必要的行为,因为当选择项目时,会发送额外的请求#381,并将尽快修补。”

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