Skip to content

Commit

Permalink
Fixed remove all data from group
Browse files Browse the repository at this point in the history
  • Loading branch information
DigneshGujarathi committed Dec 29, 2020
1 parent 2479a64 commit 184b037
Show file tree
Hide file tree
Showing 3 changed files with 8 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
5 changes: 4 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 @@ -100,6 +100,9 @@ export const AutoComplete: React.SFC<AutocompleteProps> = ({
setSearchTerm('');
onChange('');
}
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 184b037

Please sign in to comment.