From b2c21e82484f34277fa0f31265093af9c7335c50 Mon Sep 17 00:00:00 2001 From: Nikhil Kothari Date: Fri, 12 Apr 2024 19:40:39 +0530 Subject: [PATCH] fix: filter selected users in dropdown --- .../components/feature/select-member/AddMembersDropdown.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raven-app/src/components/feature/select-member/AddMembersDropdown.tsx b/raven-app/src/components/feature/select-member/AddMembersDropdown.tsx index 1c965ccba..b0a00479e 100644 --- a/raven-app/src/components/feature/select-member/AddMembersDropdown.tsx +++ b/raven-app/src/components/feature/select-member/AddMembersDropdown.tsx @@ -28,8 +28,9 @@ const AddMembersDropdown = ({ channelMembers, label = 'Select users', selectedUs const lowerCasedInputValue = inputValue.toLowerCase() return nonChannelMembers.filter((user: UserFields) => { + const isUserSelected = selectedUsers.find(selectedUser => selectedUser.name === user.name) return ( - !selectedUsers.includes(user) && + !isUserSelected && (user.full_name.toLowerCase().includes(lowerCasedInputValue) || user.name.toLowerCase().includes(lowerCasedInputValue)) )