mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Merge pull request #47319 from nextcloud/fix/47056/focus-unified-search-on-open
fix(UnifiedSearch): Focus search input on open
This commit is contained in:
commit
3b795cde79
3 changed files with 13 additions and 6 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 = []
|
||||
|
|
|
|||
4
dist/core-unified-search.js
vendored
4
dist/core-unified-search.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-unified-search.js.map
vendored
2
dist/core-unified-search.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue