diff --git a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/EditOwnersModal.tsx b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/EditOwnersModal.tsx index 9dcbf42aac2f56..0197a1655a9464 100644 --- a/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/EditOwnersModal.tsx +++ b/datahub-web-react/src/app/entity/shared/containers/profile/sidebar/Ownership/EditOwnersModal.tsx @@ -332,18 +332,7 @@ export const EditOwnersModal = ({ function handleBlur() { setInputValue(''); } - const [defaultValue, setDefaultValue] = useState<any>(); - // If the modal content is dynamic or the modal is not rendered immediately. - // we ned need to use the useEffect hook to ensure that the Select component gets the default value after the modal is mounted. - useEffect(() => { - const defaultOwner = selectedOwners.map((owner) => ({ - key: owner.value.ownerUrn, - value: owner.value.ownerUrn, - label: owner.label, - })); - setDefaultValue(defaultOwner); - }, [selectedOwners]); return ( <Modal title={title || `${operationType === OperationType.ADD ? 'Add' : 'Remove'} Owners`} @@ -387,7 +376,6 @@ export const EditOwnersModal = ({ tagRender={tagRender} onBlur={handleBlur} value={selectedOwners as any} - defaultValue={defaultValue} > {ownerSearchOptions} </SelectInput>