Skip to content

fix: allow deletion of custom tag named 'Other' via toggleTag button#1465

Open
shabnam311 wants to merge 1 commit into
aryandas2911:mainfrom
shabnam311:fix/toggle-tag-other-deletion
Open

fix: allow deletion of custom tag named 'Other' via toggleTag button#1465
shabnam311 wants to merge 1 commit into
aryandas2911:mainfrom
shabnam311:fix/toggle-tag-other-deletion

Conversation

@shabnam311

Copy link
Copy Markdown
Contributor

Description

Fixes #1396

Problem

In TaskFormModal.jsx, the toggleTag function has a special case for the "Other" tag — it immediately returns after toggling the custom tag input, without ever checking whether "Other" is already present in the user's tags array.

This means:

  1. User clicks "Other" → custom input appears → user types "Other" → tag is added ✅
  2. User clicks "Other" button again to remove it → the function just toggles the input visibility and never removes the tag

The tag becomes permanently stuck and can only be removed by clearing the entire form.

Fix

Added a check inside the toggleTag function: if "Other" is already in the tags array, clicking the "Other" button now removes it from the array and hides the custom input. Only if "Other" is not in the tags array does clicking the button toggle the custom input visibility.

Changes

  • frontend/src/components/Task/TaskFormModal.jsx — Updated toggleTag() to check tags.includes("Other") before toggling the custom input

Testing

  • Created a task and added "Other" as a custom tag → confirmed it can now be removed by clicking the "Other" button
  • Verified that the custom input toggle still works correctly when "Other" is not in the tags array
  • Verified that predefined tags (Homework, Routine, Creative) still toggle normally

@aryandas2911

Copy link
Copy Markdown
Owner

resolve conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Users cannot delete the custom tag named "Other" from their tasks due to toggleTag event interception

2 participants