Skip to content

added a check before submitting todo to handle empty case#307

Closed
shahdelwan0 wants to merge 1 commit intomdn:mainfrom
shahdelwan0:fix/empty-todo
Closed

added a check before submitting todo to handle empty case#307
shahdelwan0 wants to merge 1 commit intomdn:mainfrom
shahdelwan0:fix/empty-todo

Conversation

@shahdelwan0
Copy link

Description

Motivation

Additional details

Related issues and pull requests

@shahdelwan0 shahdelwan0 requested review from a team as code owners March 20, 2026 02:50
@shahdelwan0 shahdelwan0 requested a review from pepelsbey March 20, 2026 02:50
@chrisdavidmills
Copy link
Collaborator

Sorry, @shahdelwan0, but we can't just make changes to the example code without also updating the accompanying tutorials.

I am also not convinced this code is the best way to handle this — the preventDefault() should happen regardless of whether the input was empty (otherwise the form will submit as per standard behavior), you've used equality rather than strict equality, and I don't know why the commented out console.logs are necessary to include.

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.

3 participants