Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Allows deselection of members in add members modal for a group #8349

Merged
merged 2 commits into from
Jul 30, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ export const AddGroupMembersModal = ({ urn, visible, onCloseModal, onSubmit }: P
setSelectedMembers(newUsers);
};

const onDeselectMember = (memberUrn: string) => {
const onDeselectMember = (memberUrn: { key: string; label: React.ReactNode; value: string }) => {
setInputValue('');
const newUserActors = selectedMembers.filter((user) => user !== memberUrn);
const newUserActors = selectedMembers.filter((user) => user.value !== memberUrn.value);
Comment on lines +86 to +88
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix! I would suggest a rename of memberUrn to just member since it's an object we're getting back. definitely not blocking this approval though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your input! Created another PR for the variable rename suggestion since the current one was merged -
#8529

setSelectedMembers(newUserActors);
};

Expand Down
Loading