优化搜索框交互逻辑

pull/1761/head
lyswhut 2023-12-12 13:25:25 +08:00
parent 11317154f6
commit 6fc5a47970
2 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,7 @@
- 更新zh-tw翻译
- 自定义源列显示源版本号、作者名字
- 优化列表全选机制,修复列表未获得焦点时仍然可以全选的问题
- 优化搜索框交互逻辑,防止鼠标操作时意外搜索候选列表的内容
### 修复

View File

@ -32,7 +32,7 @@
</button>
</div>
<div v-if="list" :class="$style.list" :style="listStyle">
<ul ref="dom_list">
<ul ref="dom_list" @mouseleave="selectIndex = -1">
<li
v-for="(item, index) in list"
:key="item"
@ -142,7 +142,10 @@ export default {
},
handleSearch() {
this.hideList()
if (this.selectIndex < 0) { this.sendEvent('submit'); return }
if (this.selectIndex < 0) {
this.sendEvent('submit')
return
}
this.sendEvent('listClick', this.selectIndex)
},
showList() {