Permalink
Browse files

trim input

  • Loading branch information...
amejiarosario committed Aug 13, 2018
1 parent a73e058 commit 45b4eed44abd9a4cfec3b3977b61fe7031ff6c4e
Showing with 2 additions and 2 deletions.
  1. +2 −2 app.js
4 app.js
@@ -12,7 +12,7 @@ const todoApp = new Vue({
methods: {
createTodo(event) {
const textbox = event.target;
this.todos.push({ text: textbox.value, isDone: false });
this.todos.push({ text: textbox.value.trim(), isDone: false });
textbox.value = '';
},
startEditing(todo) {
@@ -21,7 +21,7 @@ const todoApp = new Vue({
finishEditing(event) {
if (!this.editing) { return; }
const textbox = event.target;
this.editing.text = textbox.value;
this.editing.text = textbox.value.trim();
this.editing = null;
},
cancelEditing() {

0 comments on commit 45b4eed

Please sign in to comment.