@samitouri / QOS-React-2 / commits / 2e2dc6708f

fix(examples/todo): don't submit empty values (#10979)

Pooya Parsa committed Sep 30, 2017 at 18:50 UTC 2e2dc6708f7e25e0574030e96b31dbbc9c36856a
1 file changed +3
docs/_js/examples/todo.js
+3
@@ -26,6 +26,9 @@ class TodoApp extends React.Component {
26
27 handleSubmit(e) {
28 e.preventDefault();
29 + if (!this.state.text.length) {
30 + return;
31 + }
32 var newItem = {
33 text: this.state.text,
34 id: Date.now()