From 6cfe229332a4d56594ca0fc8fb3e034c8d27217f Mon Sep 17 00:00:00 2001 From: Ethan Presberg <1320941+zedatrix@users.noreply.github.com> Date: Tue, 20 Feb 2024 04:49:37 -0500 Subject: [PATCH] feat(frontend): Allow sending a message with the enter key (#6378) This has not yet been tested due to an issue with compiling on WSL. This was the fix suggested by Pwuts. --- frontend/lib/views/chat/chat_input_field.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frontend/lib/views/chat/chat_input_field.dart b/frontend/lib/views/chat/chat_input_field.dart index b46badd61833..650e0eff792c 100644 --- a/frontend/lib/views/chat/chat_input_field.dart +++ b/frontend/lib/views/chat/chat_input_field.dart @@ -116,6 +116,12 @@ class _ChatInputFieldState extends State { child: TextField( controller: _controller, focusNode: _focusNode, + // Enable enter key stroke to send the message + // Untested but submitted at Pwuts recommendation + onSubmitted: () { + widget.onSendPressed(_controller.text); + _controller.clear(); + }, // Allowing the TextField to expand vertically and accommodate multiple lines maxLines: null, decoration: InputDecoration(