Add Task dialog form fields persist after closing/canceling
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:
- Go to
http://localhost:5173/home - Click "Add Task" button to open the Add Task dialog
- Fill in some details:
- Description: "Test task"
- Priority: "L"
- Project: Select any project
- Add a tag: "urgent"
- Click "Cancel" button OR click outside the dialog to close it
- Click "Add Task" button again to reopen the dialog
- 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:
newTaskstate (description, priority, project, due, tags)tagInputstate
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.
This is intentional and is helpful in case one accidentally closes the form