Merge pull request #8555 from aignatov-bio/ai-sci-11964-head-of-project-search-auto-focus

Fix focus on search field [SCI-11964]
This commit is contained in:
Martin Artnik 2025-06-09 13:47:43 +02:00 committed by GitHub
commit 2d28f02b14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
<template>
<div v-if="params.data.supervised_by">
<GeneralDropdown v-if="canManage" @open="loadUsers" @close="closeFlyout" position="right">
<GeneralDropdown v-if="canManage" @open="openFlyout" @close="closeFlyout" position="right">
<template v-slot:field>
<div class="flex items-center gap-1 cursor-pointer h-9">
<div v-if="params.data.supervised_by.id" class="flex items-center gap-2" :title="params.data.supervised_by.name">
@ -75,19 +75,20 @@ export default {
this.loadUsers();
}
},
mounted() {
this.$nextTick(() => {
if (this.$refs.searchInput) {
this.$refs.searchInput.focus();
}
});
},
computed: {
canManage() {
return this.params.data.urls.update;
}
},
methods: {
openFlyout() {
this.loadUsers();
this.$nextTick(() => {
if (this.$refs.searchInput) {
this.$refs.searchInput.focus();
}
});
},
loadUsers() {
axios.get(this.params.data.urls.assigned_users, {
params: {