Merge pull request #5447 from pangeachat/5443-keep-input-focus-after-message-send

chore: keep input focused after send
This commit is contained in:
ggurdin 2026-01-27 10:07:41 -05:00 committed by GitHub
commit b3fcab3aa1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

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

View file

@ -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;
}