From 97e9ac55c47fc1123c96a8a9f20431d8bded533b Mon Sep 17 00:00:00 2001 From: sherlock Date: Mon, 19 Feb 2024 16:12:46 +0700 Subject: [PATCH] TW-1031: tap outside of screen also close the keyboard --- lib/pages/chat/chat.dart | 7 +++++++ lib/pages/chat/chat_event_list.dart | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 29dbd9f5cf..0758f744f9 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -1448,6 +1448,13 @@ class ChatController extends State } } + void onHideKeyboardAndEmoji() { + hideKeyboardChatScreen(); + if (!PlatformInfos.isWeb) { + showEmojiPickerNotifier.value = false; + } + } + void onKeyboardAction() { showEmojiPickerNotifier.toggle(); inputFocus.requestFocus(); diff --git a/lib/pages/chat/chat_event_list.dart b/lib/pages/chat/chat_event_list.dart index ef224afb89..580a56add8 100644 --- a/lib/pages/chat/chat_event_list.dart +++ b/lib/pages/chat/chat_event_list.dart @@ -182,7 +182,7 @@ class ChatEventList extends StatelessWidget { controller.listHorizontalActionMenuBuilder(), onMenuAction: controller.handleHorizontalActionMenu, hideKeyboardChatScreen: - controller.hideKeyboardChatScreen, + controller.onHideKeyboardAndEmoji, markedUnreadLocation: controller.unreadReceivedMessageLocation, hideTimeStamp: isInView,