Skip to content

Commit

Permalink
优化搜索框交互逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Dec 12, 2023
1 parent 1131715 commit 6fc5a47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions publish/changeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- 更新zh-tw翻译
- 自定义源列显示源版本号、作者名字
- 优化列表全选机制,修复列表未获得焦点时仍然可以全选的问题
- 优化搜索框交互逻辑,防止鼠标操作时意外搜索候选列表的内容

### 修复

Expand Down
7 changes: 5 additions & 2 deletions src/renderer/components/material/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 6fc5a47

Please sign in to comment.