Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(UnifiedSearch): Focus search input on open
Resolves : #47056

Signed-off-by: fenn-cs <[email protected]>
  • Loading branch information
nfebe authored and AndyScherzinger committed Aug 20, 2024
commit 716b8c896ead9dc8480179a5e6773b139216cc86
13 changes: 10 additions & 3 deletions core/src/components/UnifiedSearch/UnifiedSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
},

Expand Down Expand Up @@ -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 = []
Expand Down