Skip to content

Fix #77: Disable Add button when input is empty#231

Open
khan1020 wants to merge 1 commit into
Axe-Pearl:masterfrom
khan1020:fix-todo-button
Open

Fix #77: Disable Add button when input is empty#231
khan1020 wants to merge 1 commit into
Axe-Pearl:masterfrom
khan1020:fix-todo-button

Conversation

@khan1020

@khan1020 khan1020 commented Jul 2, 2026

Copy link
Copy Markdown

Hi! 👋

This PR fixes the issue where the "Add" button remained active even when the input field was empty.

Changes made:

  1. Logic (Home.jsx): Added the disabled property to the button, checking if the trimmed input is empty (disabled={!todo.trim()}).
  2. Styling (App.css): Added a :disabled CSS state to visually grey out the button and change the cursor so the user knows it cannot be clicked.

Fixes #77

Capture

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.

Disable Add button when input is empty

1 participant