【问题标题】:AutoComplete showing suggestions not based on start of word自动完成显示不基于单词开头的建议
【发布时间】:2022-01-06 03:27:02
【问题描述】:

它建议ReunionTunisia 在顶部,因为它们有uni 位。

期望的行为:

它应该根据单词的开头提出建议。即,United Arab Emirates 应显示在顶部等。

【问题讨论】:

    标签: reactjs autocomplete material-ui


    【解决方案1】:

    查看customising the filter function 上的文档。

    const filterOptions = createFilterOptions({
      matchFrom: 'start',
    });
    
    <Autocomplete filterOptions={filterOptions} />;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-27
      • 2013-10-20
      • 1970-01-01
      • 1970-01-01
      • 2013-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多