首页 > 解决方案 > Twitter typeahead 未突出显示该元素

问题描述

我有一个下拉列表,当我在搜索中查找某些内容并尝试通过向下箭头进行选择时,它不是阴影和/或突出显示元素。我为此使用 typeahead.js。

$('#theSearchBox').typeahead({
    hint: true,
    highlight: true,
    minLength: 1
  },
  {
    name: 'HOUSES',
    source: substringMatcher(

      function(){
        let items=[];
        for(let key in SCHOOLS){
          items.push(HOUSES[key].House);
        }
        return items;
      }()

    ),
    limit: 10
  }
  );

  $('#theSearchBox2').typeahead({
    hint: true,
    highlight: true,
    minLength: 1
  },
  {
    name: 'HOUSES',
    source: substringMatcher(

      function(){
        let items=[];
        for(let key in HOUSES){
          items.push(HOUSES[key].House);
        }
        return items;
      }()

    ),
    limit: 10
  }
  );   

标签: javascripthtmltypeahead.js

解决方案


推荐阅读