From 2e2dc6708f7e25e0574030e96b31dbbc9c36856a Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 30 Sep 2017 18:50:01 +0330 Subject: [PATCH] fix(examples/todo): don't submit empty values (#10979) --- docs/_js/examples/todo.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_js/examples/todo.js b/docs/_js/examples/todo.js index eaac631dec..f7977a5302 100644 --- a/docs/_js/examples/todo.js +++ b/docs/_js/examples/todo.js @@ -26,6 +26,9 @@ class TodoApp extends React.Component { handleSubmit(e) { e.preventDefault(); + if (!this.state.text.length) { + return; + } var newItem = { text: this.state.text, id: Date.now()