From 9f760cf0fae5e3bb92df0bed90ceccce9dc7d680 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Thu, 2 Jul 2026 23:00:04 +0200 Subject: [PATCH] fix(frontend): stop group modals clearing selection on background refetch The reset effect in GroupAddClientsModal and GroupRemoveClientsModal depended on the memoized rows, which are rebuilt whenever GroupsPage re-renders because candidates/members are inline-filtered arrays. The 5s client-list poll re-renders the page, so any selection made in the modal was wiped a few seconds later. Reset only when the modal opens. --- frontend/src/pages/groups/GroupAddClientsModal.tsx | 2 +- frontend/src/pages/groups/GroupRemoveClientsModal.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/groups/GroupAddClientsModal.tsx b/frontend/src/pages/groups/GroupAddClientsModal.tsx index f7c433320..fbc8056c6 100644 --- a/frontend/src/pages/groups/GroupAddClientsModal.tsx +++ b/frontend/src/pages/groups/GroupAddClientsModal.tsx @@ -50,7 +50,7 @@ export default function GroupAddClientsModal({ if (!open) return; setSelectedEmails([]); setSearch(''); - }, [open, rows]); + }, [open]); const filteredRows = useMemo(() => { const q = search.trim().toLowerCase(); diff --git a/frontend/src/pages/groups/GroupRemoveClientsModal.tsx b/frontend/src/pages/groups/GroupRemoveClientsModal.tsx index 81125a3ec..0ea75e651 100644 --- a/frontend/src/pages/groups/GroupRemoveClientsModal.tsx +++ b/frontend/src/pages/groups/GroupRemoveClientsModal.tsx @@ -48,7 +48,7 @@ export default function GroupRemoveClientsModal({ if (!open) return; setSelectedEmails([]); setSearch(''); - }, [open, rows]); + }, [open]); const filteredRows = useMemo(() => { const q = search.trim().toLowerCase();