Prevent a new line in the middle of a sentance from sending a message
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2022-07-06 14:19:33 -07:00
parent 44fba12d21
commit e8a638ed29
1 changed files with 4 additions and 0 deletions

View File

@ -628,6 +628,10 @@ class _MessageViewState extends State<MessageView> {
var data = event.data;
if (event is RawKeyUpEvent) {
if ((data.logicalKey == LogicalKeyboardKey.enter && !event.isShiftPressed) || data.logicalKey == LogicalKeyboardKey.numpadEnter && !event.isShiftPressed) {
// Don't send when inserting a new line that is not at the end of the message
if (ctrlrCompose.selection.baseOffset != ctrlrCompose.text.length) {
return;
}
_sendMessage();
}
}