From 7af7fb0a5333521cd55e624f1cc8489c8f411b3c Mon Sep 17 00:00:00 2001 From: Nathaniel Rindlaub Date: Thu, 15 Aug 2024 15:53:21 -0700 Subject: [PATCH] Reset edit label form after submit --- src/features/projects/ManageLabelsModal/EditLabelForm.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/projects/ManageLabelsModal/EditLabelForm.jsx b/src/features/projects/ManageLabelsModal/EditLabelForm.jsx index 1c7a0e2c..3798e50e 100644 --- a/src/features/projects/ManageLabelsModal/EditLabelForm.jsx +++ b/src/features/projects/ManageLabelsModal/EditLabelForm.jsx @@ -23,9 +23,10 @@ const EditLabelForm = ({ label, labels, setLabelToDelete, setAlertOpen }) => { const [showForm, setShowForm] = useState(false); const toggleOpenForm = useCallback(() => setShowForm((prev) => !prev), []); - const onSubmit = useCallback((values) => { + const onSubmit = useCallback((values, { resetForm }) => { dispatch(updateProjectLabel(values)); setShowForm(false); + resetForm(); }, []); const deleteLabel = useCallback((values) => {