diff --git a/exam_frontend/src/components/AddAsset/AddAsset.tsx b/exam_frontend/src/components/AddAsset/AddAsset.tsx index 0c317464e..ac4f6ecb1 100644 --- a/exam_frontend/src/components/AddAsset/AddAsset.tsx +++ b/exam_frontend/src/components/AddAsset/AddAsset.tsx @@ -233,10 +233,25 @@ const AddAsset: React.FC = ({ } }; const handleResetForm = () => { - setFormData({}); // Clear the form data - setResetForm(true); // Trigger reset + setFormData({}); + setResetForm(true); + setassettypeValue(""); + setValue(""); + setLicenseValue(""); + setOwnerValue(""); + setAssetLocation(""); + setAssetBu(""); + setModelNumber(""); + setOs(""); + setOsVersion(""); + setMobileOs(""); + setProcessor(""); + setProcessorGen(""); + setMemory(""); + setStorage(""); + setTimeout(() => { - setResetForm(false); // Reset the trigger after a short delay + setResetForm(false); }, 100); }; @@ -472,6 +487,7 @@ const AddAsset: React.FC = ({ displayEmpty onChange={(event) => { setAssetCategoryValue(event.target.value as string); + handleResetForm(); setFormData({ ...formData, asset_category: event.target.value as string, diff --git a/exam_frontend/src/components/Tooltip/Tooltip.tsx b/exam_frontend/src/components/Tooltip/Tooltip.tsx index b06ef42fc..77741f745 100644 --- a/exam_frontend/src/components/Tooltip/Tooltip.tsx +++ b/exam_frontend/src/components/Tooltip/Tooltip.tsx @@ -9,6 +9,7 @@ const ToolTip: React.FC = ({ title, children }) => ( title={title} placement="top" TransitionComponent={Zoom} + disableInteractive > {children}