From d84951c70c2cc7c6b27cfea781a1302b658e35ff Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Fri, 10 Jun 2022 16:16:55 -0400 Subject: [PATCH] Add update chatters when focusing textfield (#143) --- lib/screens/channel/stores/chat_store.dart | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/screens/channel/stores/chat_store.dart b/lib/screens/channel/stores/chat_store.dart index c86d06b9..1a57128f 100644 --- a/lib/screens/channel/stores/chat_store.dart +++ b/lib/screens/channel/stores/chat_store.dart @@ -125,10 +125,16 @@ abstract class ChatStoreBase with Store { } }); - // Add a listener to the textfield focus that will hide the emote menu if it is currently shown. textFieldFocusNode.addListener(() { - if (textFieldFocusNode.hasFocus && assetsStore.showEmoteMenu) assetsStore.showEmoteMenu = false; + if (textFieldFocusNode.hasFocus) { + // Hide the emote menu if it is currently shown. + if (assetsStore.showEmoteMenu) assetsStore.showEmoteMenu = false; + // Refresh the chatters list to keep autocomplete mentions updated. + if (settings.autocomplete) chatDetailsStore.updateChatters(channelName); + } + + // Un-expand the chat when unfocusing. if (!textFieldFocusNode.hasFocus) expandChat = false; });