修复搜索框bug
parent
fe44581a61
commit
14423e0eb3
|
@ -6,3 +6,4 @@
|
|||
#### 修复
|
||||
|
||||
- 修复搜索提示失效的问题
|
||||
- 修复从歌单或列表点击搜索按钮搜索目标歌曲时,搜索框未聚焦仍然弹出候选搜索列表的问题
|
||||
|
|
|
@ -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()
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue