Skip to content

Commit

Permalink
Merge pull request #863 from glific/bug/remove-group
Browse files Browse the repository at this point in the history
Fixed remove all data from group
  • Loading branch information
mdshamoon authored Dec 29, 2020
2 parents 2479a64 + 6fa2ec5 commit a37db4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/UI/DialogBox/DialogBox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
min-width: 459px;
margin: 0 auto;
height: unset !important;
max-height: 90% !important;
}

.Dialogbox Form {
Expand Down
4 changes: 3 additions & 1 deletion src/components/UI/Form/AutoComplete/AutoComplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const AutoComplete: React.SFC<AutocompleteProps> = ({
if (roleSelection) {
roleSelection(value);
}
if (asyncSearch) {
if (asyncSearch && value.length > 0) {
const filterValues = asyncValues.value.filter(
(val: any) => val.id !== value[value.length - 1].id
);
Expand All @@ -99,6 +99,8 @@ export const AutoComplete: React.SFC<AutocompleteProps> = ({
}
setSearchTerm('');
onChange('');
} else if (asyncSearch && value.length === 0) {
asyncValues.setValue([]);
}
if (onChange) {
onChange(value);
Expand Down
4 changes: 3 additions & 1 deletion src/containers/Group/GroupList/GroupList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ export const GroupList: React.SFC<GroupListProps> = () => {
asyncSearch
selectedOptions={groupContacts}
onChange={(value: any) => {
setContactSearchTerm(value);
if (typeof value === 'string') {
setContactSearchTerm(value);
}
}}
/>
);
Expand Down

0 comments on commit a37db4f

Please sign in to comment.