修复搜索框bug
parent
fe44581a61
commit
14423e0eb3
|
@ -6,3 +6,4 @@
|
||||||
#### 修复
|
#### 修复
|
||||||
|
|
||||||
- 修复搜索提示失效的问题
|
- 修复搜索提示失效的问题
|
||||||
|
- 修复从歌单或列表点击搜索按钮搜索目标歌曲时,搜索框未聚焦仍然弹出候选搜索列表的问题
|
||||||
|
|
|
@ -23,6 +23,7 @@ export default {
|
||||||
visibleList: false,
|
visibleList: false,
|
||||||
tipList: [],
|
tipList: [],
|
||||||
tipSearch: null,
|
tipSearch: null,
|
||||||
|
isFocused: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -64,10 +65,12 @@ export default {
|
||||||
handleEvent({ action, data }) {
|
handleEvent({ action, data }) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'focus':
|
case 'focus':
|
||||||
|
this.isFocused = true
|
||||||
if (!this.visibleList) this.visibleList = true
|
if (!this.visibleList) this.visibleList = true
|
||||||
if (this.searchText) this.handleTipSearch()
|
if (this.searchText) this.handleTipSearch()
|
||||||
break
|
break
|
||||||
case 'blur':
|
case 'blur':
|
||||||
|
this.isFocused = false
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.visibleList) this.visibleList = false
|
if (this.visibleList) this.visibleList = false
|
||||||
}, 50)
|
}, 50)
|
||||||
|
@ -84,7 +87,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
handleTipSearch() {
|
handleTipSearch() {
|
||||||
if (!this.visibleList) this.visibleList = true
|
if (!this.visibleList && this.isFocused) this.visibleList = true
|
||||||
this.tipSearch()
|
this.tipSearch()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue