From 63aa9619e6fee2af1d4e8cce675fb6904323138e Mon Sep 17 00:00:00 2001 From: Janez T Date: Fri, 13 Mar 2026 19:38:05 +0100 Subject: [PATCH] Clear message input on send --- lib/screens/messages_tab.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/screens/messages_tab.dart b/lib/screens/messages_tab.dart index 7accc02..29e2f1e 100644 --- a/lib/screens/messages_tab.dart +++ b/lib/screens/messages_tab.dart @@ -598,6 +598,9 @@ class _MessagesTabState extends State { return; } + _textController.clear(); + _focusNode.unfocus(); + try { // Check destination type and send accordingly if (_destinationType == @@ -628,13 +631,18 @@ class _MessagesTabState extends State { await _sendToChannel(text, connectionProvider, messagesProvider, 0); } - _textController.clear(); - _focusNode.unfocus(); _markCurrentDestinationAsRead(); if (!mounted) return; } catch (e) { if (!mounted) return; + if (_textController.text.isEmpty) { + _textController.text = text; + _textController.selection = TextSelection.collapsed( + offset: _textController.text.length, + ); + _focusNode.requestFocus(); + } ToastLogger.error(context, 'Failed to send: $e'); } }