Fix focus on search field [SCI-11964]

This commit is contained in:
Anton 2025-06-09 11:15:34 +02:00
parent ae1d128588
commit 7d95fcf7f4

View file

@ -1,6 +1,6 @@
<template> <template>
<div v-if="params.data.supervised_by"> <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> <template v-slot:field>
<div class="flex items-center gap-1 cursor-pointer h-9"> <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"> <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(); this.loadUsers();
} }
}, },
mounted() {
this.$nextTick(() => {
if (this.$refs.searchInput) {
this.$refs.searchInput.focus();
}
});
},
computed: { computed: {
canManage() { canManage() {
return this.params.data.urls.update; return this.params.data.urls.update;
} }
}, },
methods: { methods: {
openFlyout() {
this.loadUsers();
this.$nextTick(() => {
if (this.$refs.searchInput) {
this.$refs.searchInput.focus();
}
});
},
loadUsers() { loadUsers() {
axios.get(this.params.data.urls.assigned_users, { axios.get(this.params.data.urls.assigned_users, {
params: { params: {