Skip to content

[Bug] New Project modal does not reset form fields on close #170

@VishakBaddur

Description

@VishakBaddur

Describe the bug

When the "New Project" modal is closed without submitting, the form fields (Project Name, Project Description, and file upload) retain
their values. Reopening the modal shows the previously entered data instead of a blank form.

Steps to Reproduce

  1. Click "New Project" to open the modal
  2. Enter a project name, description, and select a file
  3. Click "Close" without submitting
  4. Click "New Project" again
  5. Observe: previous values are still present in all fields

Expected behavior

The modal should reset all fields to empty/null when closed.

Root Cause

handleCloseModal in Homescreen.jsx only calls setShowModal(false) but does not reset the three form state values.

Suggested Fix

const handleCloseModal = () => {
  setShowModal(false);
  setProjectName("");
  setProjectDescription("");
  setFileUpload(null);
};

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