We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug When applying multiple stopwatch.Start commands, stopwatch starts ticking faster with each one.
Setup Please complete the following information along with version numbers, if applicable.
To Reproduce Steps to reproduce the behavior:
Source Code
package main import ( "log" "github.com/charmbracelet/bubbles/stopwatch" tea "github.com/charmbracelet/bubbletea" ) func main() { p := tea.NewProgram(initialModel()) if _, err := p.Run(); err != nil { log.Fatal(err) } } type model struct { stopwatch stopwatch.Model } func initialModel() model { return model{ stopwatch: stopwatch.New(), } } func (m model) Init() tea.Cmd { return nil } func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmds []tea.Cmd var cmd tea.Cmd switch msg := msg.(type) { case tea.KeyMsg: switch msg.Type { case tea.KeyEnter: cmds = append(cmds, m.stopwatch.Start()) case tea.KeyCtrlC: return m, tea.Quit } } m.stopwatch, cmd = m.stopwatch.Update(msg) cmds = append(cmds, cmd) return m, tea.Batch(cmds...) } func (m model) View() string { return m.stopwatch.View() }
Expected behavior Stopwatch starts with the first press of enter and keeps running at expected speed with every subsequent Start message
Screenshots
Additional context The vhs tape for the above gif is
Output demo.gif Show Type ./bubbles_bugreport Enter Sleep 3s Enter Enter Enter Enter Sleep 10
Somehow, the TickMsg get stacked with every Start() call
TickMsg
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When applying multiple stopwatch.Start commands, stopwatch starts ticking faster with each one.
Setup
Please complete the following information along with version numbers, if applicable.
To Reproduce
Steps to reproduce the behavior:
Source Code
Expected behavior
Stopwatch starts with the first press of enter and keeps running at expected speed with every subsequent Start message
Screenshots
Additional context
The vhs tape for the above gif is
Somehow, the
TickMsg
get stacked with every Start() callThe text was updated successfully, but these errors were encountered: