修复搜索框bug

pull/96/head
lyswhut 2019-10-27 10:00:43 +08:00
parent fe44581a61
commit 14423e0eb3
2 changed files with 5 additions and 1 deletions

View File

@ -6,3 +6,4 @@
#### 修复
- 修复搜索提示失效的问题
- 修复从歌单或列表点击搜索按钮搜索目标歌曲时,搜索框未聚焦仍然弹出候选搜索列表的问题

View File

@ -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()
},