ccsync icon indicating copy to clipboard operation
ccsync copied to clipboard

Add Task dialog form fields persist after closing/canceling

Open ShivaGupta-14 opened this issue 11 months ago • 1 comments

Describe the bug When adding a task, if you fill in all the details (description, priority, project, due date, tags) and then close the dialog by clicking outside or clicking the Cancel button, the form fields retain their values. Opening the Add Task dialog again shows the previously entered data instead of a clean/reset form.

To Reproduce Steps to reproduce the behavior:

  1. Go to http://localhost:5173/home
  2. Click "Add Task" button to open the Add Task dialog
  3. Fill in some details:
    • Description: "Test task"
    • Priority: "L"
    • Project: Select any project
    • Add a tag: "urgent"
  4. Click "Cancel" button OR click outside the dialog to close it
  5. Click "Add Task" button again to reopen the dialog
  6. See that all previously entered values are still present

Expected behavior When the Add Task dialog is closed (either via Cancel button or by clicking outside), all form fields should be reset to their default/empty values. Reopening the dialog should show a clean form ready for new task entry.

Video

https://github.com/user-attachments/assets/c95e419f-bc70-4af9-b8eb-9aafc232a0e6

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: Latest

Additional context The issue is in Tasks.tsx. The useEffect that runs when isAddTaskOpen changes only resets isCreatingNewProject, but does not reset:

  • newTask state (description, priority, project, due, tags)
  • tagInput state

The form is only reset after a successful task submission, not when the dialog is cancelled/closed.

  • [X] I want to work on this issue.

ShivaGupta-14 avatar Dec 14 '25 01:12 ShivaGupta-14

This is intentional and is helpful in case one accidentally closes the form

its-me-abhishek avatar Dec 21 '25 07:12 its-me-abhishek