Skip to content

Commit

Permalink
Reset edit label form after submit
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielrindlaub committed Aug 15, 2024
1 parent 5189331 commit 7af7fb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/projects/ManageLabelsModal/EditLabelForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 7af7fb0

Please sign in to comment.