From 4c43c463309e7e647dc001325341c4af17a7dd89 Mon Sep 17 00:00:00 2001 From: Patrick Browne Date: Wed, 29 May 2024 17:11:35 +0200 Subject: [PATCH] feat: Use onExited to reset the dataset iri --- app/configurator/components/add-new-dataset-panel.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/configurator/components/add-new-dataset-panel.tsx b/app/configurator/components/add-new-dataset-panel.tsx index 8e00b125a..7bfdedbf9 100644 --- a/app/configurator/components/add-new-dataset-panel.tsx +++ b/app/configurator/components/add-new-dataset-panel.tsx @@ -80,10 +80,10 @@ export const AddNewDatasetPanel = () => { const handleClose = useEventCallback(() => { close(); - setTimeout(() => { - // Give time to the drawer to close before resetting the dataset IRI - setDataSetIri(""); - }, 500); + }); + + const handleExited = useEventCallback(() => { + setDataSetIri(""); }); return ( @@ -92,6 +92,9 @@ export const AddNewDatasetPanel = () => { open={isOpen} variant="temporary" onClose={handleClose} + SlideProps={{ + onExited: handleExited, + }} PaperProps={{ sx: { width: "1400px",