From 184b037cf4aae9069d3de92cf947545dfe0e9082 Mon Sep 17 00:00:00 2001 From: DigneshGujarathi <dignesh.gujarathi@webaccessglobal.com> Date: Tue, 29 Dec 2020 13:36:33 +0530 Subject: [PATCH 1/2] Fixed remove all data from group --- src/components/UI/DialogBox/DialogBox.module.css | 1 + src/components/UI/Form/AutoComplete/AutoComplete.tsx | 5 ++++- src/containers/Group/GroupList/GroupList.tsx | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/UI/DialogBox/DialogBox.module.css b/src/components/UI/DialogBox/DialogBox.module.css index 8b20283df..cd67dce23 100644 --- a/src/components/UI/DialogBox/DialogBox.module.css +++ b/src/components/UI/DialogBox/DialogBox.module.css @@ -13,6 +13,7 @@ min-width: 459px; margin: 0 auto; height: unset !important; + max-height: 90% !important; } .Dialogbox Form { diff --git a/src/components/UI/Form/AutoComplete/AutoComplete.tsx b/src/components/UI/Form/AutoComplete/AutoComplete.tsx index 539dbfd75..9fea85e3e 100644 --- a/src/components/UI/Form/AutoComplete/AutoComplete.tsx +++ b/src/components/UI/Form/AutoComplete/AutoComplete.tsx @@ -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 ); @@ -100,6 +100,9 @@ export const AutoComplete: React.SFC<AutocompleteProps> = ({ setSearchTerm(''); onChange(''); } + if (asyncSearch && value.length === 0) { + asyncValues.setValue([]); + } if (onChange) { onChange(value); } diff --git a/src/containers/Group/GroupList/GroupList.tsx b/src/containers/Group/GroupList/GroupList.tsx index f81e51daa..cbeb0f367 100644 --- a/src/containers/Group/GroupList/GroupList.tsx +++ b/src/containers/Group/GroupList/GroupList.tsx @@ -225,7 +225,9 @@ export const GroupList: React.SFC<GroupListProps> = () => { asyncSearch selectedOptions={groupContacts} onChange={(value: any) => { - setContactSearchTerm(value); + if (typeof value === 'string') { + setContactSearchTerm(value); + } }} /> ); From 6fa2ec5e6d70acc6bd933e9339b230cc87d90964 Mon Sep 17 00:00:00 2001 From: DigneshGujarathi <dignesh.gujarathi@webaccessglobal.com> Date: Tue, 29 Dec 2020 14:31:15 +0530 Subject: [PATCH 2/2] Feedback fixes --- src/components/UI/Form/AutoComplete/AutoComplete.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/UI/Form/AutoComplete/AutoComplete.tsx b/src/components/UI/Form/AutoComplete/AutoComplete.tsx index 9fea85e3e..16831ec98 100644 --- a/src/components/UI/Form/AutoComplete/AutoComplete.tsx +++ b/src/components/UI/Form/AutoComplete/AutoComplete.tsx @@ -99,8 +99,7 @@ export const AutoComplete: React.SFC<AutocompleteProps> = ({ } setSearchTerm(''); onChange(''); - } - if (asyncSearch && value.length === 0) { + } else if (asyncSearch && value.length === 0) { asyncValues.setValue([]); } if (onChange) {