Artifact on second view
noahfraiture opened this issue · comments
Noah commented
Describe the bug
Hey,
I have a problem with my list rendering, my second model display an artifact from the first one like you can see on the images. Sometimes it it's 'test' but 'jon' which proove that it isn't an element from the second model wrongly render.
func (m model) viewConv() string {
return m.conv.style.Render(m.conv.list.View()) + "\n"
}
func (m model) updateConv(msg tea.Msg) (tea.Model, tea.Cmd) {
if msg, ok := msg.(tea.KeyMsg); ok {
switch msg.Type {
case tea.KeyEnter:
if i, ok := m.conv.list.SelectedItem().(itemConv); ok {
m.chat.conversation = (*Conversation)(&i)
m.switchToChat()
m.conv.choice = (*Conversation)(&i)
}
}
}
var cmd tea.Cmd
m.conv.list, cmd = m.conv.list.Update(msg)
return m, cmd
}
With a view for ai basically the same and an update that does nothing in particular which update the list like here.
Setup
- Arch linux
- Kitty with zsh
To Reproduce
Steps to reproduce the behavior:
- Run the code and press enter on the first view. My project is in public and you can get it here : https://github.com/NoahFraiture/tuwi