Skip to content

fix: prevent adding empty or whitespace-only tasks to To-Do list (#670)#672

Open
harsharajkumar-273 wants to merge 2 commits into
lovelymahor:mainfrom
harsharajkumar-273:fix/empty-tasks-validation
Open

fix: prevent adding empty or whitespace-only tasks to To-Do list (#670)#672
harsharajkumar-273 wants to merge 2 commits into
lovelymahor:mainfrom
harsharajkumar-273:fix/empty-tasks-validation

Conversation

@harsharajkumar-273

@harsharajkumar-273 harsharajkumar-273 commented Jul 15, 2026

Copy link
Copy Markdown

Description

This PR addresses issue #670 by adding validation checks to prevent users from adding blank tasks or tasks containing only whitespace/spaces to the To-Do list.

Closes #670

Proposed Changes

  • Task Title Validation: Implemented .trim() check on form.title inside handleSubmit of Todo.js.
  • Form Error State: Introduced local error state in Todo component to capture validation errors and display them directly in the UI.
  • Dynamic UX: Automatically clears the error when the user starts typing a valid task title or picks a date.

Verification

  • Entering empty strings or spaces only triggers the warning message "Task title is required" and stops submission.
  • Form operates normally with valid inputs.

@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Lovely Mahour's projects Team on Vercel.

A member of the Team first needs to authorize it.

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: Empty tasks can be added to the To-Do list

1 participant