Remove blink state when changing focus

This commit is contained in:
Christian Rocha
2020-02-17 17:00:01 -05:00
parent f087c8260a
commit 577baf306d
2 changed files with 29 additions and 9 deletions

View File

@@ -29,7 +29,7 @@ type Model struct {
func initialize() (tea.Model, tea.Cmd) {
n := input.DefaultModel()
n.Placeholder = "Name"
n.Focus = true
n.Focus()
e := input.DefaultModel()
e.Placeholder = "Email"
@@ -75,10 +75,10 @@ func update(msg tea.Msg, model tea.Model) (tea.Model, tea.Cmd) {
for i := 0; i < len(inputs); i++ {
if i == m.index {
inputs[i].Focus = true
inputs[i].Focus()
continue
}
inputs[i].Focus = false
inputs[i].Blur()
}
m.nameInput = inputs[0]