diff --git a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx index 60ab5bcf..aec9d130 100644 --- a/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +++ b/packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx @@ -261,7 +261,7 @@ export default function SimpleTableManual(props: PropsWithChildren(null); const fileInputRef = useRef(null); const [toggleUploadBegin, setToggleUploadBegin] = useState(false); const deleteFile = useCallback( (file, fileIndex) => { - setAnchorEl(null); + setMenuAnchorEl(null); + setMenuOpenIndex(null); // reset the file input so that it will allow re-uploading the same file after deletion if (fileInputRef.current) { @@ -426,16 +427,23 @@ export default function Attachment(props: AttachmentProps) { isArrayDeepMerge: false, removePropertyFromChangedList: true }); + } else { + const serverFiles = transformAttachments(); + attachmentCount.current = attachments.length; + filesWithError.current = []; + setFiles(serverFiles); } } }, [memoizedAttachments]); - const handleClick = event => { - setAnchorEl(event.currentTarget); + const handleClick = (event, index) => { + setMenuAnchorEl(event.currentTarget); + setMenuOpenIndex(index); }; const handleClose = () => { - setAnchorEl(null); + setMenuAnchorEl(null); + setMenuOpenIndex(null); }; const content = ( @@ -498,20 +506,28 @@ export default function Attachment(props: AttachmentProps) {
handleClick(event, index)} size='large' > - + { - setAnchorEl(null); + handleClose(); onFileDownload(item.responseProps ? item.responseProps : {}); }} >