From adda09d1ca0ef764bff1b7e86bd401784edcf6aa Mon Sep 17 00:00:00 2001 From: ayn2op Date: Wed, 1 Apr 2026 18:27:00 -0400 Subject: [PATCH] fix(chat): only hide mentions list layer if it is visible in removeMentionsList (#787) --- internal/ui/chat/message_input.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ui/chat/message_input.go b/internal/ui/chat/message_input.go index 612cced..21b72ff 100644 --- a/internal/ui/chat/message_input.go +++ b/internal/ui/chat/message_input.go @@ -613,7 +613,10 @@ func (mi *messageInput) addMentionUser(user *discord.User) { } func (mi *messageInput) removeMentionsList() { - mi.chat.HideLayer(mentionsListLayerName) + // Make sure that the layer is visible before hiding it to avoid a refocus in the parent. + if mi.chat.GetVisible(mentionsListLayerName) { + mi.chat.HideLayer(mentionsListLayerName) + } } func (mi *messageInput) stopTabCompletion(emit func(tview.Command)) {