diff options
author | Ethan Presberg <1320941+zedatrix@users.noreply.github.com> | 2024-02-20 04:49:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 10:49:37 +0100 |
commit | 6cfe229332a4d56594ca0fc8fb3e034c8d27217f (patch) | |
tree | 9f91db941d87638ee1242d803e26adf48a7f4e1b | |
parent | fix(ci/benchmark): Unbreak "Push reports to data branch" step (diff) | |
download | Auto-GPT-6cfe229332a4d56594ca0fc8fb3e034c8d27217f.tar.gz Auto-GPT-6cfe229332a4d56594ca0fc8fb3e034c8d27217f.tar.bz2 Auto-GPT-6cfe229332a4d56594ca0fc8fb3e034c8d27217f.zip |
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.
-rw-r--r-- | frontend/lib/views/chat/chat_input_field.dart | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/frontend/lib/views/chat/chat_input_field.dart b/frontend/lib/views/chat/chat_input_field.dart index b46badd61..650e0eff7 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<ChatInputField> { 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( |