feat(chat): dismiss after send to recover screen space

This commit is contained in:
cogwheel0
2025-10-24 00:39:43 +05:30
parent 9c2cf347a7
commit 15299ecd82

View File

@@ -210,7 +210,14 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
PlatformUtils.lightHaptic(); PlatformUtils.lightHaptic();
widget.onSendMessage(text); widget.onSendMessage(text);
_controller.clear(); _controller.clear();
// Keep focus and keyboard open; do not collapse automatically
// Dismiss keyboard after sending to recover screen space
_focusNode.unfocus();
try {
SystemChannels.textInput.invokeMethod('TextInput.hide');
} catch (_) {
// Silently handle if keyboard dismissal fails
}
} }
void _insertNewline() { void _insertNewline() {