我有一个搜索框,当我搜索一个值时,比如银行名称,它会显示与搜索框中给出的文本匹配的结果。但这里的问题是它可能不是一个确切的结果,而且通过在搜索结果中智能刷新,加载完整列表需要几秒钟。因此,即使我等待加载某些结果,它也会立即获取当时出现的值,但实际上它会在几秒钟后刷新列表。那么我怎样才能等待完成加载然后取出结果。请对此有任何帮助。
代码片段
<ul class="DropDown__options DropDown__options--small--focused DropDown__options--focused" id="searchTopBank-listbox" role="listbox" aria-activedescendant="searchTopBank-options-4">
<li aria-selected="true" class="DropDown__option TypeAhead__option DropDown__option--focused DropDown__option--small" id="searchTopBank-options-0" role="option">
<img alt="" class="dropdown-logo" src="data">
<span>
<span class="DropDown__matched-option-chars">Bank of America</span>
</span>
</li>
<li aria-selected="false" class="DropDown__option TypeAhead__option DropDown__option--focused DropDown__option--small" id="searchTopBank-options-1" role="option">
<img alt="" class="dropdown-logo" src="data">
<span>First National
<span class="DropDown__matched-option-chars">Bank of America</span>
</span>
</li>
<li aria-selected="false" class="DropDown__option TypeAhead__option DropDown__option--focused DropDown__option--small" id="searchTopBank-options-2" role="option">
<img alt="" class="dropdown-logo" src="data:image/png;base64, null">
<span>Second National Farmer's
<span class="DropDown__matched-option-chars">Bank of America</span>
</span>
</li>
<li aria-selected="false" class="DropDown__option TypeAhead__option DropDown__option--focused DropDown__option--small" id="searchTopBank-options-3" role="option">
<img alt="" class="dropdown-logo" src="data:image/png;base64, null">
<span>
<span class="DropDown__matched-option-chars">Altabank</span>
</span>
</li>
<li aria-selected="false" class="DropDown__option TypeAhead__option DropDown__option--focused DropDown__option--hover DropDown__option--small" id="searchTopBank-options-4" role="option">
<img alt="" class="dropdown-logo" src="data:image/png;base64, null">
<span>Freedom
<span class="DropDown__matched-option-chars">Bank of America</span>
</span>
</li>
</ul>