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.
This commit is contained in:
Ethan Presberg
2024-02-20 04:49:37 -05:00
committed by GitHub
parent 1079d71699
commit 6cfe229332

View File

@@ -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(