diff --git a/src/frontend/src/components/uploadButton.tsx b/src/frontend/src/components/uploadButton.tsx index b6d90a1e..81454168 100644 --- a/src/frontend/src/components/uploadButton.tsx +++ b/src/frontend/src/components/uploadButton.tsx @@ -387,6 +387,17 @@ const FileUploadZone: React.FC = ({ } }, [fileLimitExceeded]); + // Auto-hide file rejection errors after 10 seconds + useEffect(() => { + if (fileRejectionErrors.length > 0) { + const timer = setTimeout(() => { + setFileRejectionErrors([]); + }, 5000); + + return () => clearTimeout(timer); + } + }, [fileRejectionErrors]); + return (
= ({ )}
-
+
{/* Show file rejection errors for invalid type or size */} {fileRejectionErrors.length > 0 && ( setFileRejectionErrors([])} + dismissButtonAriaLabel="Close" styles={messageBarErrorStyles} >