mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(UnifiedSearch): Focus search input on open
Resolves : https://github.com/nextcloud/server/issues/47056 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
This commit is contained in:
parent
ba9638eae5
commit
cf59575120
1 changed files with 10 additions and 3 deletions
|
|
@ -304,8 +304,11 @@ export default defineComponent({
|
|||
watch: {
|
||||
open() {
|
||||
// Load results when opened with already filled query
|
||||
if (this.open && this.searchQuery) {
|
||||
this.find(this.searchQuery)
|
||||
if (this.open) {
|
||||
this.focusInput()
|
||||
if (this.searchQuery) {
|
||||
this.find(this.searchQuery)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -351,7 +354,11 @@ export default defineComponent({
|
|||
this.$emit('update:query', this.searchQuery)
|
||||
this.$emit('update:open', false)
|
||||
},
|
||||
|
||||
focusInput() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.searchInput?.focus()
|
||||
})
|
||||
},
|
||||
find(query: string) {
|
||||
if (query.length === 0) {
|
||||
this.results = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue