From b44be13c091b08bf6b3aa870ed9991aac522686d Mon Sep 17 00:00:00 2001 From: Shabnam Date: Sun, 7 Jun 2026 23:46:10 +0530 Subject: [PATCH] fix: allow deletion of custom tag named 'Other' via toggleTag button --- frontend/src/components/Task/TaskFormModal.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Task/TaskFormModal.jsx b/frontend/src/components/Task/TaskFormModal.jsx index c4dc0285..e3ed4078 100644 --- a/frontend/src/components/Task/TaskFormModal.jsx +++ b/frontend/src/components/Task/TaskFormModal.jsx @@ -139,7 +139,13 @@ export default function TaskFormModal({ const toggleTag = (tagName) => { if (tagName === "Other") { - // toggle showing the custom input + // If "Other" is already in the tags array (added as a custom tag), remove it + if (tags.includes("Other")) { + setTags((prev) => prev.filter((t) => t !== "Other")); + setShowOtherInput(false); + return; + } + // Otherwise toggle showing the custom input setShowOtherInput((s) => !s); return; }