Skip to content

Commit

Permalink
feat(frontend): Allow sending a message with the enter key (#6378)
Browse files Browse the repository at this point in the history
This has not yet been tested due to an issue with compiling on WSL. This was the fix suggested by Pwuts.
  • Loading branch information
zedatrix authored Feb 20, 2024
1 parent 1079d71 commit 6cfe229
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/lib/views/chat/chat_input_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6cfe229

Please # to comment.