Fixed a bug where memberlist index will be reset on blur/focus

This commit is contained in:
2025-01-21 17:15:49 +02:00
parent 51489063d8
commit d85a00428d
2 changed files with 4 additions and 3 deletions

View File

@@ -511,7 +511,6 @@ func (m *Model) move(direction int) {
m.chat.Focus()
case FocusRightSidebar:
m.networkList.Blur()
m.memberList.Blur()
m.frequencyList.Blur()
m.chat.Blur()
m.memberList.Focus()

View File

@@ -57,7 +57,7 @@ func New() Model {
index: -1,
focus: false,
width: -1,
height: 1,
height: -1,
}
}
@@ -204,7 +204,9 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
func (m *Model) Focus() {
m.focus = true
m.SetIndex(0)
if m.index == -1 {
m.SetIndex(0)
}
}
func (m *Model) Blur() {