mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 16:50:55 -04:00
Merge pull request #41706 from nextcloud/backport/41652/stable28
[stable28] Focus global search input on open
This commit is contained in:
commit
20be3a737d
3 changed files with 17 additions and 4 deletions
|
|
@ -13,7 +13,8 @@
|
|||
<!-- Global search form -->
|
||||
<div ref="globalSearch" class="global-search-modal">
|
||||
<h1>{{ t('core', 'Global search') }}</h1>
|
||||
<NcInputField :value.sync="searchQuery"
|
||||
<NcInputField ref="searchInput"
|
||||
:value.sync="searchQuery"
|
||||
type="text"
|
||||
:label="t('core', 'Search apps, files, tags, messages') + '...'"
|
||||
@update:value="debouncedFind" />
|
||||
|
|
@ -222,6 +223,15 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
isVisible(value) {
|
||||
this.$nextTick(() => {
|
||||
if (value) {
|
||||
this.focusInput()
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
getProviders().then((providers) => {
|
||||
this.providers = providers
|
||||
|
|
@ -503,6 +513,9 @@ export default {
|
|||
this.dateFilter.text = t('core', `Between ${this.dateFilter.startFrom.toLocaleDateString()} and ${this.dateFilter.endAt.toLocaleDateString()}`)
|
||||
this.updateDateFilter()
|
||||
},
|
||||
focusInput() {
|
||||
this.$refs.searchInput.$el.children[0].children[0].focus()
|
||||
},
|
||||
closeModal() {
|
||||
this.$refs.globalSearchModal.close()
|
||||
this.searchQuery = ''
|
||||
|
|
|
|||
4
dist/core-global-search.js
vendored
4
dist/core-global-search.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-global-search.js.map
vendored
2
dist/core-global-search.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue