Commit 535791f8 authored by Alex Browne's avatar Alex Browne

Humble: Don't create new todos with empty titles. Fixes #1516.

parent 28bd694f
......@@ -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