Commit 79e3fed8 authored by Sam Saccone's avatar Sam Saccone

Merge pull request #1523 from albrow/humble-fix-empty-todos

Humble: Don't create new todos with empty titles. Fixes #1516.
parents 28bd694f 535791f8
......@@ -107,8 +107,11 @@ func (v *App) CreateTodo(ev dom.Event) {
if !ok {
panic("Could not convert event target to dom.HTMLInputElement")
}
v.Todos.AddTodo(strings.TrimSpace(input.Value))
document.QuerySelector(".new-todo").(dom.HTMLElement).Focus()
title := strings.TrimSpace(input.Value)
if title != "" {
v.Todos.AddTodo(title)
document.QuerySelector(".new-todo").(dom.HTMLElement).Focus()
}
}
// ClearCompleted is an event listener which removes all the completed todos
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment