diff --git a/publish/changeLog.md b/publish/changeLog.md index cf657ab7..c2054ff4 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -6,3 +6,4 @@ #### 修复 - 修复搜索提示失效的问题 +- 修复从歌单或列表点击搜索按钮搜索目标歌曲时,搜索框未聚焦仍然弹出候选搜索列表的问题 diff --git a/src/renderer/components/core/Toolbar.vue b/src/renderer/components/core/Toolbar.vue index 9d2ed72a..1549524c 100644 --- a/src/renderer/components/core/Toolbar.vue +++ b/src/renderer/components/core/Toolbar.vue @@ -23,6 +23,7 @@ export default { visibleList: false, tipList: [], tipSearch: null, + isFocused: false, } }, computed: { @@ -64,10 +65,12 @@ export default { handleEvent({ action, data }) { switch (action) { case 'focus': + this.isFocused = true if (!this.visibleList) this.visibleList = true if (this.searchText) this.handleTipSearch() break case 'blur': + this.isFocused = false setTimeout(() => { if (this.visibleList) this.visibleList = false }, 50) @@ -84,7 +87,7 @@ export default { }, handleTipSearch() { - if (!this.visibleList) this.visibleList = true + if (!this.visibleList && this.isFocused) this.visibleList = true this.tipSearch() },