Merge pull request #5447 from pangeachat/5443-keep-input-focus-after-message-send
chore: keep input focused after send
This commit is contained in:
commit
b3fcab3aa1
2 changed files with 5 additions and 2 deletions
|
|
@ -881,7 +881,6 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
Future<String?> sendFakeMessage(Event? edit, Event? reply) async {
|
||||
if (sendController.text.trim().isEmpty) return null;
|
||||
final message = sendController.text;
|
||||
inputFocus.unfocus();
|
||||
sendController.setSystemText("", EditTypeEnum.other);
|
||||
|
||||
return room.sendFakeMessage(
|
||||
|
|
@ -904,6 +903,10 @@ class ChatController extends State<ChatPageWithRoom>
|
|||
pendingText = '';
|
||||
|
||||
final tempEventId = await sendFakeMessage(edit, reply);
|
||||
if (!inputFocus.hasFocus) {
|
||||
inputFocus.requestFocus();
|
||||
}
|
||||
|
||||
final content = await choreographer.getMessageContent(message);
|
||||
choreographer.clear();
|
||||
|
||||
|
|
|
|||
|
|
@ -353,6 +353,7 @@ class Choreographer extends ChangeNotifier {
|
|||
}
|
||||
|
||||
void _onOpenIT() {
|
||||
inputFocus.unfocus();
|
||||
final itMatch = igcController.openMatches.firstWhere(
|
||||
(match) => match.updatedMatch.isITStart,
|
||||
orElse: () =>
|
||||
|
|
@ -378,7 +379,6 @@ class Choreographer extends ChangeNotifier {
|
|||
);
|
||||
}
|
||||
|
||||
debugPrint("DISMISSED: ${itController.dismissed}");
|
||||
if (itController.dismissed) {
|
||||
_timesDismissedIT.value = _timesDismissedIT.value + 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue