Skip to content

Add Task dialog form fields persist after closing/canceling #277

@ShivaGupta-14

Description

@ShivaGupta-14

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

Screen.Recording.2025-12-14.at.6.38.37.AM.mov

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.

  • I want to work on this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions