From 87ce2d0e899d2c117938a112c43267e081c34b9b Mon Sep 17 00:00:00 2001 From: VishalS-Microsoft Date: Thu, 5 Mar 2026 12:26:17 +0530 Subject: [PATCH] fix: Error message does not auto-dismiss and close (X) icon is missing when uploading unsupported file --- src/frontend/src/components/uploadButton.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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} >