Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(frontend): Allow sending a message with the enter key (#6378)

Ethan Presberg6cfe229332a4
diff --git a/frontend/lib/views/chat/chat_input_field.dart b/frontend/lib/views/chat/chat_input_field.dart
index b46badd618..650e0eff79 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(