Don't focus searchbars if no filter when switching tabs (#477)

When switching tabs in channels, things, inbox, pages
list, the searchbar.clear() function refocuses the
searchbar which brings up a virtual keyboard on mobile
and/or a backdrop or iOS. Since there's apparently no
way to prevent this behavior, do it only when there's
a value for the searchbar's filter.

Signed-off-by: Yannick Schaus <github@schaus.net>
pull/481/head
Yannick Schaus 2020-11-01 12:03:59 +01:00 committed by GitHub
parent 39f83915c5
commit d1019fb4a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 8 deletions

View File

@ -154,8 +154,12 @@ export default {
this.showLinked = val
const searchbar = this.$refs.searchbar.$el.f7Searchbar
const filterQuery = searchbar.query
searchbar.clear()
if (filterQuery) this.$nextTick(() => { searchbar.search(filterQuery) })
this.$nextTick(() => {
if (filterQuery) {
searchbar.clear()
searchbar.search(filterQuery)
}
})
},
selectChannel (channel, channelType) {
if (this.pickerMode) {

View File

@ -202,9 +202,11 @@ export default {
this.groupBy = groupBy
const searchbar = this.$refs.searchbar.$el.f7Searchbar
const filterQuery = searchbar.query
searchbar.clear()
this.$nextTick(() => {
if (filterQuery) searchbar.search(filterQuery)
if (filterQuery) {
searchbar.clear()
searchbar.search(filterQuery)
}
if (groupBy === 'alphabetical') this.$refs.listIndex.update()
})
},

View File

@ -171,9 +171,11 @@ export default {
this.groupBy = groupBy
const searchbar = this.$refs.searchbar.$el.f7Searchbar
const filterQuery = searchbar.query
searchbar.clear()
this.$nextTick(() => {
if (filterQuery) searchbar.search(filterQuery)
if (filterQuery) {
searchbar.clear()
searchbar.search(filterQuery)
}
if (groupBy === 'alphabetical') this.$refs.listIndex.update()
})
},

View File

@ -162,9 +162,11 @@ export default {
this.groupBy = groupBy
const searchbar = this.$refs.searchbar.$el.f7Searchbar
const filterQuery = searchbar.query
searchbar.clear()
this.$nextTick(() => {
if (filterQuery) searchbar.search(filterQuery)
if (filterQuery) {
searchbar.clear()
searchbar.search(filterQuery)
}
if (groupBy === 'alphabetical') this.$refs.listIndex.update()
})
},