Unable to set focus on the table to scroll or navidate up and down #1256
Replies: 1 comment
|
func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "esc":
m.textInput.Blur()
m.table.Focus()
return m, nil
case "ctrl+c":
return m, tea.Quit
case "enter":
m.table.Blur()
cmd = m.textInput.Focus()
if title := m.textInput.Value(); title != "" {
m.add(title)
m.textInput.Reset()
}
return m, cmd
}
if m.table.Focused() {
m.table, cmd = m.table.Update(msg)
return m, cmd
}
m.textInput, cmd = m.textInput.Update(msg)
return m, cmd
}
m.textInput, cmd = m.textInput.Update(msg)
return m, cmd
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
All reactions