mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-23 22:32:59 +03:00
Use up/down to go between fields too
This commit is contained in:
parent
943ebe42d2
commit
f087c8260a
@ -52,13 +52,21 @@ func update(msg tea.Msg, model tea.Model) (tea.Model, tea.Cmd) {
|
||||
case "tab":
|
||||
fallthrough
|
||||
case "enter":
|
||||
|
||||
fallthrough
|
||||
case "up":
|
||||
fallthrough
|
||||
case "down":
|
||||
inputs := []input.Model{
|
||||
m.nameInput,
|
||||
m.emailInput,
|
||||
}
|
||||
|
||||
m.index++
|
||||
if msg.String() == "up" {
|
||||
m.index--
|
||||
} else {
|
||||
m.index++
|
||||
}
|
||||
|
||||
if m.index > len(inputs)-1 {
|
||||
m.index = 0
|
||||
} else if m.index < 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user