aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorfenn-cs <fenn25.fn@gmail.com>2024-08-19 07:28:55 +0100
committerfenn-cs <fenn25.fn@gmail.com>2024-08-19 13:49:34 +0100
commitcf59575120bee70e7573f94251d7b08bbd07e0a2 (patch)
tree5f759d659819d0d811c7710e16a0ec94be0af701 /core/src
parentba9638eae5376aa97e496c629b27aaa9d1c8f330 (diff)
downloadnextcloud-server-cf59575120bee70e7573f94251d7b08bbd07e0a2.tar.gz
nextcloud-server-cf59575120bee70e7573f94251d7b08bbd07e0a2.zip
fix(UnifiedSearch): Focus search input on open
Resolves : https://github.com/nextcloud/server/issues/47056 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/components/UnifiedSearch/UnifiedSearchModal.vue13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
index ac1348ed8e6..f28ed31074f 100644
--- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
+++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
@@ -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 = []