Replies: 4 comments
-
same issue |
Beta Was this translation helpful? Give feedback.
-
Suggestions:
@@ -66,6 +66,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// INCREMENT STEP
case tea.KeyEnter:
m.step += 1
+ if m.step == 2 {
+ m.nameInput.Blur()
+ return m, m.noteInput.Focus()
+ }
return m, nil
}
@@ -78,8 +82,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case 1:
m.nameInput, cmd = m.nameInput.Update(msg)
case 2:
- m.nameInput.Blur()
- m.noteInput.Focus()
m.noteInput, cmd = m.noteInput.Update(msg)
} |
Beta Was this translation helpful? Give feedback.
-
Hey @ic-768, welcome in! From what I see here, it looks like you'd be better off using When you return only a single command, that is the only operation happening during that m.textarea, cmd = m.textarea.Update(msg)
cmds = append(cmds, cmd)
return m, tea.Batch(cmds...) You can see an example of this here: https://github.com/charmbracelet/bubbletea/blob/c1cd8bba561eacea8f0985cad4a718c1a9cde61d/examples/textarea/main.go#L70-L72 More on commands: https://charm.sh/blog/commands-in-bubbletea/ I hope that helps! Please let me know if anything is still unclear after what I've included above :) |
Beta Was this translation helpful? Give feedback.
-
Well, you need to return blink result of every input in update()? |
Beta Was this translation helpful? Give feedback.
-
Hi all. I'm new to bubble tea and bubbles, and I'm trying to make multiple inputs blink, however I can only make the very first one work. All successive inputs don't have cursor blinking
Here's my code
nameInput's cursor blinks fine. But noteInput doesn't. Also changing noteInput to another textInput doesn't help.
Beta Was this translation helpful? Give feedback.
All reactions